mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-18 04:28:40 +00:00
rename[array]: rename primitive array list
This commit is contained in:
@@ -751,7 +751,7 @@ public abstract class ByteBufUtils {
|
||||
}
|
||||
|
||||
public static List<Boolean> readBooleanList(ByteBuf byteBuf) {
|
||||
return new ArrayBooleanList(readBooleanArray(byteBuf));
|
||||
return new ArrayListBoolean(readBooleanArray(byteBuf));
|
||||
}
|
||||
|
||||
public static void writeBooleanSet(ByteBuf byteBuf, Set<Boolean> set) {
|
||||
@@ -824,7 +824,7 @@ public abstract class ByteBufUtils {
|
||||
}
|
||||
|
||||
public static List<Byte> readByteList(ByteBuf byteBuf) {
|
||||
return new ArrayByteList(readByteArray(byteBuf));
|
||||
return new ArrayListByte(readByteArray(byteBuf));
|
||||
}
|
||||
|
||||
public static void writeByteSet(ByteBuf byteBuf, Set<Byte> set) {
|
||||
@@ -905,7 +905,7 @@ public abstract class ByteBufUtils {
|
||||
}
|
||||
|
||||
public static List<Short> readShortList(ByteBuf byteBuf) {
|
||||
return new ArrayShortList(readShortArray(byteBuf));
|
||||
return new ArrayListShort(readShortArray(byteBuf));
|
||||
}
|
||||
|
||||
public static void writeShortSet(ByteBuf byteBuf, Set<Short> set) {
|
||||
@@ -979,7 +979,7 @@ public abstract class ByteBufUtils {
|
||||
}
|
||||
|
||||
public static List<Integer> readIntList(ByteBuf byteBuf) {
|
||||
return new ArrayIntList(readIntArray(byteBuf));
|
||||
return new ArrayListInt(readIntArray(byteBuf));
|
||||
}
|
||||
|
||||
public static void writeIntSet(ByteBuf byteBuf, Set<Integer> set) {
|
||||
@@ -1053,7 +1053,7 @@ public abstract class ByteBufUtils {
|
||||
}
|
||||
|
||||
public static List<Long> readLongList(ByteBuf byteBuf) {
|
||||
return new ArrayLongList(readLongArray(byteBuf));
|
||||
return new ArrayListLong(readLongArray(byteBuf));
|
||||
}
|
||||
|
||||
public static void writeLongSet(ByteBuf byteBuf, Set<Long> set) {
|
||||
@@ -1134,7 +1134,7 @@ public abstract class ByteBufUtils {
|
||||
}
|
||||
|
||||
public static List<Float> readFloatList(ByteBuf byteBuf) {
|
||||
return new ArrayFloatList(readFloatArray(byteBuf));
|
||||
return new ArrayListFloat(readFloatArray(byteBuf));
|
||||
}
|
||||
|
||||
public static void writeFloatSet(ByteBuf byteBuf, Set<Float> set) {
|
||||
@@ -1215,7 +1215,7 @@ public abstract class ByteBufUtils {
|
||||
}
|
||||
|
||||
public static List<Double> readDoubleList(ByteBuf byteBuf) {
|
||||
return new ArrayDoubleList(readDoubleArray(byteBuf));
|
||||
return new ArrayListDouble(readDoubleArray(byteBuf));
|
||||
}
|
||||
|
||||
public static void writeDoubleSet(ByteBuf byteBuf, Set<Double> set) {
|
||||
|
||||
+3
-3
@@ -18,16 +18,16 @@ import java.util.*;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ArrayBooleanList implements List<Boolean> {
|
||||
public class ArrayListBoolean implements List<Boolean> {
|
||||
|
||||
private boolean[] array;
|
||||
private int size;
|
||||
|
||||
public ArrayBooleanList(int initialCapacity) {
|
||||
public ArrayListBoolean(int initialCapacity) {
|
||||
this.array = new boolean[initialCapacity];
|
||||
}
|
||||
|
||||
public ArrayBooleanList(boolean[] array) {
|
||||
public ArrayListBoolean(boolean[] array) {
|
||||
this.array = array;
|
||||
this.size = array.length;
|
||||
}
|
||||
+3
-3
@@ -18,16 +18,16 @@ import java.util.*;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ArrayByteList implements List<Byte> {
|
||||
public class ArrayListByte implements List<Byte> {
|
||||
|
||||
private byte[] array;
|
||||
private int size;
|
||||
|
||||
public ArrayByteList(int initialCapacity) {
|
||||
public ArrayListByte(int initialCapacity) {
|
||||
this.array = new byte[initialCapacity];
|
||||
}
|
||||
|
||||
public ArrayByteList(byte[] array) {
|
||||
public ArrayListByte(byte[] array) {
|
||||
this.array = array;
|
||||
this.size = array.length;
|
||||
}
|
||||
+3
-3
@@ -18,16 +18,16 @@ import java.util.*;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ArrayDoubleList implements List<Double> {
|
||||
public class ArrayListDouble implements List<Double> {
|
||||
|
||||
private double[] array;
|
||||
private int size;
|
||||
|
||||
public ArrayDoubleList(int initialCapacity) {
|
||||
public ArrayListDouble(int initialCapacity) {
|
||||
this.array = new double[initialCapacity];
|
||||
}
|
||||
|
||||
public ArrayDoubleList(double[] array) {
|
||||
public ArrayListDouble(double[] array) {
|
||||
this.array = array;
|
||||
this.size = array.length;
|
||||
}
|
||||
+3
-3
@@ -18,16 +18,16 @@ import java.util.*;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ArrayFloatList implements List<Float> {
|
||||
public class ArrayListFloat implements List<Float> {
|
||||
|
||||
private float[] array;
|
||||
private int size;
|
||||
|
||||
public ArrayFloatList(int initialCapacity) {
|
||||
public ArrayListFloat(int initialCapacity) {
|
||||
this.array = new float[initialCapacity];
|
||||
}
|
||||
|
||||
public ArrayFloatList(float[] array) {
|
||||
public ArrayListFloat(float[] array) {
|
||||
this.array = array;
|
||||
this.size = array.length;
|
||||
}
|
||||
+3
-3
@@ -18,16 +18,16 @@ import java.util.*;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ArrayIntList implements List<Integer> {
|
||||
public class ArrayListInt implements List<Integer> {
|
||||
|
||||
private int[] array;
|
||||
private int size;
|
||||
|
||||
public ArrayIntList(int initialCapacity) {
|
||||
public ArrayListInt(int initialCapacity) {
|
||||
this.array = new int[initialCapacity];
|
||||
}
|
||||
|
||||
public ArrayIntList(int[] array) {
|
||||
public ArrayListInt(int[] array) {
|
||||
this.array = array;
|
||||
this.size = array.length;
|
||||
}
|
||||
+3
-3
@@ -18,16 +18,16 @@ import java.util.*;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ArrayLongList implements List<Long> {
|
||||
public class ArrayListLong implements List<Long> {
|
||||
|
||||
private long[] array;
|
||||
private int size;
|
||||
|
||||
public ArrayLongList(int initialCapacity) {
|
||||
public ArrayListLong(int initialCapacity) {
|
||||
this.array = new long[initialCapacity];
|
||||
}
|
||||
|
||||
public ArrayLongList(long[] array) {
|
||||
public ArrayListLong(long[] array) {
|
||||
this.array = array;
|
||||
this.size = array.length;
|
||||
}
|
||||
+3
-3
@@ -18,16 +18,16 @@ import java.util.*;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ArrayShortList implements List<Short> {
|
||||
public class ArrayListShort implements List<Short> {
|
||||
|
||||
private short[] array;
|
||||
private int size;
|
||||
|
||||
public ArrayShortList(int initialCapacity) {
|
||||
public ArrayListShort(int initialCapacity) {
|
||||
this.array = new short[initialCapacity];
|
||||
}
|
||||
|
||||
public ArrayShortList(short[] array) {
|
||||
public ArrayListShort(short[] array) {
|
||||
this.array = array;
|
||||
this.size = array.length;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class ArrayListTest {
|
||||
|
||||
@Test
|
||||
public void testAdd() {
|
||||
var list = new ArrayIntList(1);
|
||||
var list = new ArrayListInt(1);
|
||||
Assert.assertTrue(list.isEmpty());
|
||||
Assert.assertEquals(list.size(), 0);
|
||||
int[] array = new int[100];
|
||||
@@ -49,9 +49,9 @@ public class ArrayListTest {
|
||||
var array1 = new int[]{0, 1, 2};
|
||||
var array2 = new int[]{3, 4, 5};
|
||||
var array3 = new int[]{6, 7, 8};
|
||||
var list1 = new ArrayIntList(array1);
|
||||
var list2 = new ArrayIntList(array2);
|
||||
var list3 = new ArrayIntList(array3);
|
||||
var list1 = new ArrayListInt(array1);
|
||||
var list2 = new ArrayListInt(array2);
|
||||
var list3 = new ArrayListInt(array3);
|
||||
list2.addAll(0, list1);
|
||||
Assert.assertArrayEquals(list2.toArrayPrimitive(), new int[]{0, 1, 2, 3, 4, 5});
|
||||
try {
|
||||
@@ -67,7 +67,7 @@ public class ArrayListTest {
|
||||
|
||||
@Test
|
||||
public void testRemove() {
|
||||
var list = new ArrayIntList(1);
|
||||
var list = new ArrayListInt(1);
|
||||
for (var i = 1; i <= 5; i++) {
|
||||
list.add(i);
|
||||
}
|
||||
@@ -102,9 +102,9 @@ public class ArrayListTest {
|
||||
var array1 = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 6, 7, 8};
|
||||
var array2 = new int[]{3, 4, 5};
|
||||
var array3 = new int[]{6, 7, 8};
|
||||
var list1 = new ArrayIntList(array1);
|
||||
var list2 = new ArrayIntList(array2);
|
||||
var list3 = new ArrayIntList(array3);
|
||||
var list1 = new ArrayListInt(array1);
|
||||
var list2 = new ArrayListInt(array2);
|
||||
var list3 = new ArrayListInt(array3);
|
||||
list1.removeAll(list3);
|
||||
Assert.assertArrayEquals(list1.toArrayPrimitive(), new int[]{0, 1, 2, 3, 4, 5});
|
||||
|
||||
@@ -116,7 +116,7 @@ public class ArrayListTest {
|
||||
|
||||
@Test
|
||||
public void testInsert() {
|
||||
var list = new ArrayIntList(1);
|
||||
var list = new ArrayListInt(1);
|
||||
for (var i = 1; i <= 3; i++) {
|
||||
list.add(i);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public class ArrayListTest {
|
||||
|
||||
@Test
|
||||
public void testSet() {
|
||||
var list = new ArrayIntList(1);
|
||||
var list = new ArrayListInt(1);
|
||||
for (var i = 1; i <= 3; i++) {
|
||||
list.add(i);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public class ArrayListTest {
|
||||
|
||||
@Test
|
||||
public void testAddRemoveLast() {
|
||||
var list = new ArrayIntList(1);
|
||||
var list = new ArrayListInt(1);
|
||||
for (var i = 1; i <= 3; i++) {
|
||||
list.add(i);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ public class ArrayListTest {
|
||||
@Test
|
||||
public void testIndexOf() {
|
||||
var srcArray = new int[]{1, 2, 3, 2, 1, 2, 3, 2, 1};
|
||||
var list = new ArrayIntList(0);
|
||||
var list = new ArrayListInt(0);
|
||||
list.addAll(ArrayUtils.toList(srcArray));
|
||||
Assert.assertArrayEquals(list.toArrayPrimitive(), srcArray);
|
||||
Assert.assertEquals(list.indexOf(1), 0);
|
||||
@@ -211,7 +211,7 @@ public class ArrayListTest {
|
||||
|
||||
@Test
|
||||
public void testIterator() {
|
||||
var list = new ArrayIntList(0);
|
||||
var list = new ArrayListInt(0);
|
||||
for (var i = 0; i < 42; i++) {
|
||||
Assert.assertTrue(list.add(i));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user