Skip to content

Commit c8a2613

Browse files
committed
update javadoc for network module
1 parent b3bfa5e commit c8a2613

38 files changed

Lines changed: 793 additions & 173 deletions

rlib-collections/src/main/java/javasabr/rlib/collections/array/LongArray.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
package javasabr.rlib.collections.array;
32

43
import java.io.Serializable;
@@ -91,12 +90,12 @@ static LongArray of(long... elements) {
9190
/**
9291
* Creates an immutable copy of the specified long array.
9392
*
94-
* @param intArray the array to copy
93+
* @param array the array to copy
9594
* @return an immutable copy
9695
* @since 10.0.0
9796
*/
98-
static LongArray copyOf(LongArray intArray) {
99-
return new ImmutableLongArray(intArray.toArray());
97+
static LongArray copyOf(LongArray array) {
98+
return new ImmutableLongArray(array.toArray());
10099
}
101100

102101
/**

rlib-collections/src/main/java/javasabr/rlib/collections/array/UnsafeMutableIntArray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public interface UnsafeMutableIntArray extends UnsafeIntArray, MutableIntArray {
3333
* @return the removed value
3434
* @since 10.0.0
3535
*/
36-
int unsafeRemoveByInex(int index);
36+
int unsafeRemoveByIndex(int index);
3737

3838
/**
3939
* Sets the value at the specified index without bounds checking.

rlib-collections/src/main/java/javasabr/rlib/collections/array/UnsafeMutableLongArray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public interface UnsafeMutableLongArray extends UnsafeLongArray, MutableLongArra
3333
* @return the removed value
3434
* @since 10.0.0
3535
*/
36-
long unsafeRemoveByInex(int index);
36+
long unsafeRemoveByIndex(int index);
3737

3838
/**
3939
* Sets the value at the specified index without bounds checking.

rlib-collections/src/main/java/javasabr/rlib/collections/array/impl/AbstractIntArray.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public boolean contains(int value) {
6161
@Override
6262
public boolean containsAll(IntArray array) {
6363
if (array.isEmpty()) {
64-
return false;
64+
return true;
6565
}
6666

6767
int[] wrapped = array.asUnsafe().wrapped();
@@ -77,7 +77,7 @@ public boolean containsAll(IntArray array) {
7777
@Override
7878
public boolean containsAll(int[] array) {
7979
if (array.length < 1) {
80-
return false;
80+
return true;
8181
}
8282
for (int value : array) {
8383
if (!contains(value)) {

rlib-collections/src/main/java/javasabr/rlib/collections/array/impl/AbstractLongArray.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public boolean contains(long value) {
6161
@Override
6262
public boolean containsAll(LongArray array) {
6363
if (array.isEmpty()) {
64-
return false;
64+
return true;
6565
}
6666
long[] wrapped = array.asUnsafe().wrapped();
6767
for (int i = 0, length = array.size(); i < length; i++) {
@@ -75,7 +75,7 @@ public boolean containsAll(LongArray array) {
7575
@Override
7676
public boolean containsAll(long[] array) {
7777
if (array.length < 1) {
78-
return false;
78+
return true;
7979
}
8080
for (long value : array) {
8181
if (!contains(value)) {

rlib-collections/src/main/java/javasabr/rlib/collections/array/impl/AbstractMutableIntArray.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public UnsafeMutableIntArray unsafeSet(int index, int value) {
6666
@Override
6767
public int removeByIndex(int index) {
6868
checkIndex(index);
69-
return unsafeRemoveByInex(index);
69+
return unsafeRemoveByIndex(index);
7070
}
7171

7272
@Override
@@ -75,7 +75,7 @@ public boolean remove(int value) {
7575
if (index < 0) {
7676
return false;
7777
}
78-
unsafeRemoveByInex(index);
78+
unsafeRemoveByIndex(index);
7979
return true;
8080
}
8181

@@ -108,7 +108,7 @@ public boolean removeAll(int[] array) {
108108
}
109109

110110
@Override
111-
public int unsafeRemoveByInex(int index) {
111+
public int unsafeRemoveByIndex(int index) {
112112
int numMoved = size() - index - 1;
113113
int[] wrapped = wrapped();
114114
int value = wrapped[index];

rlib-collections/src/main/java/javasabr/rlib/collections/array/impl/AbstractMutableLongArray.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public UnsafeMutableLongArray unsafeSet(int index, long value) {
6666
@Override
6767
public long removeByIndex(int index) {
6868
checkIndex(index);
69-
return unsafeRemoveByInex(index);
69+
return unsafeRemoveByIndex(index);
7070
}
7171

7272
@Override
@@ -75,7 +75,7 @@ public boolean remove(long value) {
7575
if (index < 0) {
7676
return false;
7777
}
78-
unsafeRemoveByInex(index);
78+
unsafeRemoveByIndex(index);
7979
return true;
8080
}
8181

@@ -108,7 +108,7 @@ public boolean removeAll(long[] array) {
108108
}
109109

110110
@Override
111-
public long unsafeRemoveByInex(int index) {
111+
public long unsafeRemoveByIndex(int index) {
112112
int numMoved = size() - index - 1;
113113
long[] wrapped = wrapped();
114114
long value = wrapped[index];

rlib-collections/src/main/java/javasabr/rlib/collections/deque/DequeFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static <E> Deque<E> linkedListBased() {
3333
* @return a new array based deque
3434
* @since 10.0.0
3535
*/
36-
public static <E> Deque<E> arrayBasedBased(Class<? super E> type) {
36+
public static <E> Deque<E> arrayBased(Class<? super E> type) {
3737
return new DefaultArrayBasedDeque<>(type);
3838
}
3939

@@ -46,7 +46,7 @@ public static <E> Deque<E> arrayBasedBased(Class<? super E> type) {
4646
* @return a new array based deque
4747
* @since 10.0.0
4848
*/
49-
public static <E> Deque<E> arrayBasedBased(Class<? super E> type, int capacity) {
49+
public static <E> Deque<E> arrayBased(Class<? super E> type, int capacity) {
5050
return new DefaultArrayBasedDeque<>(type, capacity);
5151
}
5252
}

rlib-collections/src/main/java/javasabr/rlib/collections/dictionary/impl/gc/optimized/GcOptimizedMutableHashBasedIntToRefDictionary.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public GcOptimizedMutableHashBasedIntToRefDictionary(int initCapacity, float loa
3434
//noinspection unchecked
3535
this.entries = new ReusableLinkedHashIntToRefEntry[initCapacity];
3636
this.threshold = (int) (initCapacity * loadFactor);
37-
this.entryPool = DequeFactory.arrayBasedBased(ReusableLinkedHashIntToRefEntry.class);
37+
this.entryPool = DequeFactory.arrayBased(ReusableLinkedHashIntToRefEntry.class);
3838
}
3939

4040
@Override

rlib-collections/src/test/java/javasabr/rlib/collections/deque/DequeTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ void shouldCheckContains(Deque<String> deque) {
420420
@Test
421421
void shouldRebalanceIndexesAddLastRemoveFirst() {
422422
// given:
423-
Deque<String> deque = DequeFactory.arrayBasedBased(String.class, 15);
423+
Deque<String> deque = DequeFactory.arrayBased(String.class, 15);
424424
Field head = ReflectionUtils.getUnsafeField(deque, "head");
425425
Field tail = ReflectionUtils.getUnsafeField(deque, "tail");
426426
var generator = new AtomicInteger();
@@ -541,7 +541,7 @@ void shouldRebalanceIndexesAddLastRemoveFirst() {
541541
@Test
542542
void shouldRebalanceIndexesAddFirstRemoveLast() {
543543
// given:
544-
Deque<String> deque = DequeFactory.arrayBasedBased(String.class, 15);
544+
Deque<String> deque = DequeFactory.arrayBased(String.class, 15);
545545
Field head = ReflectionUtils.getUnsafeField(deque, "head");
546546
Field tail = ReflectionUtils.getUnsafeField(deque, "tail");
547547
var generator = new AtomicInteger();
@@ -707,6 +707,6 @@ void shouldCorrectlyIterate2Deque(Deque<String> deque) {
707707
private static Stream<Arguments> generateDeque() {
708708
return Stream.of(
709709
Arguments.of(DequeFactory.linkedListBased()),
710-
Arguments.of(DequeFactory.arrayBasedBased(String.class, 15)));
710+
Arguments.of(DequeFactory.arrayBased(String.class, 15)));
711711
}
712712
}

0 commit comments

Comments
 (0)