Skip to content

Commit 8843311

Browse files
committed
Add documentation comments to array tags
1 parent 4b6747b commit 8843311

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎src/main/java/org/glavo/nbt/tag/ArrayTag.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public final boolean isEmpty() {
3838
@Contract(pure = true)
3939
public abstract int size();
4040

41+
/// Returns a sequential stream with this array as its source.
4142
@Contract(pure = true)
4243
public abstract BaseStream<E, ?> stream();
4344

‎src/main/java/org/glavo/nbt/tag/ByteArrayTag.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.jetbrains.annotations.Contract;
2121

2222
import java.io.IOException;
23-
import java.nio.Buffer;
2423
import java.nio.ByteBuffer;
2524
import java.util.*;
2625
import java.util.stream.Stream;
@@ -32,15 +31,20 @@ public final class ByteArrayTag extends ArrayTag<Byte> {
3231

3332
byte[] value;
3433

34+
/// Creates a new ByteArrayTag with an empty name and an empty array.
3535
public ByteArrayTag() {
3636
this("");
3737
}
3838

39+
/// Creates a new ByteArrayTag with the given name and an empty array.
3940
public ByteArrayTag(String name) {
4041
super(name);
4142
this.value = EMPTY;
4243
}
4344

45+
/// Creates a new ByteArrayTag with the given name and value.
46+
///
47+
/// The value is cloned to avoid external modifications.
4448
public ByteArrayTag(String name, byte[] value) {
4549
super(name);
4650
this.value = value.clone();

‎src/main/java/org/glavo/nbt/tag/IntArrayTag.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,20 @@ public final class IntArrayTag extends ArrayTag<Integer> {
3131

3232
int[] value;
3333

34+
/// Creates a new IntArrayTag with an empty name and an empty array.
3435
public IntArrayTag() {
3536
this("");
3637
}
3738

39+
/// Creates a new IntArrayTag with the given name and an empty array.
3840
public IntArrayTag(String name) {
3941
super(name);
4042
this.value = EMPTY;
4143
}
4244

45+
/// Creates a new IntArrayTag with the given name and value.
46+
///
47+
/// The value is cloned to avoid external modifications.
4348
public IntArrayTag(String name, int[] value) {
4449
super(name);
4550
this.value = value.clone();

‎src/main/java/org/glavo/nbt/tag/LongArrayTag.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,20 @@ public final class LongArrayTag extends ArrayTag<Long> {
3333

3434
long[] value;
3535

36+
/// Creates a new LongArrayTag with an empty name and an empty array.
3637
public LongArrayTag() {
3738
this("");
3839
}
3940

41+
/// Creates a new LongArrayTag with the given name and an empty array.
4042
public LongArrayTag(String name) {
4143
super(name);
4244
this.value = EMPTY;
4345
}
4446

47+
/// Creates a new LongArrayTag with the given name and value.
48+
///
49+
/// The value is cloned to avoid external modifications.
4550
public LongArrayTag(String name, long[] value) {
4651
super(name);
4752
this.value = value.clone();

0 commit comments

Comments
 (0)