mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-05-31 02:21:01 +00:00
rename[set]: rename primitive hash set
This commit is contained in:
@@ -833,7 +833,7 @@ public abstract class ByteBufUtils {
|
||||
|
||||
public static Set<Byte> readByteSet(ByteBuf byteBuf) {
|
||||
var length = readInt(byteBuf);
|
||||
var set = new HashByteSet(CollectionUtils.comfortableCapacity(length));
|
||||
var set = new HashSetByte(CollectionUtils.comfortableCapacity(length));
|
||||
for (var i = 0; i < length; i++) {
|
||||
set.add(readByte(byteBuf));
|
||||
}
|
||||
@@ -914,7 +914,7 @@ public abstract class ByteBufUtils {
|
||||
|
||||
public static Set<Short> readShortSet(ByteBuf byteBuf) {
|
||||
var length = readInt(byteBuf);
|
||||
var set = new HashShortSet(CollectionUtils.comfortableCapacity(length));
|
||||
var set = new HashSetShort(CollectionUtils.comfortableCapacity(length));
|
||||
for (var i = 0; i < length; i++) {
|
||||
set.add(readShort(byteBuf));
|
||||
}
|
||||
@@ -988,7 +988,7 @@ public abstract class ByteBufUtils {
|
||||
|
||||
public static Set<Integer> readIntSet(ByteBuf byteBuf) {
|
||||
var length = readInt(byteBuf);
|
||||
var set = new HashIntSet(CollectionUtils.comfortableCapacity(length));
|
||||
var set = new HashSetInt(CollectionUtils.comfortableCapacity(length));
|
||||
for (var i = 0; i < length; i++) {
|
||||
set.add(readInt(byteBuf));
|
||||
}
|
||||
@@ -1062,7 +1062,7 @@ public abstract class ByteBufUtils {
|
||||
|
||||
public static Set<Long> readLongSet(ByteBuf byteBuf) {
|
||||
var length = readInt(byteBuf);
|
||||
var set = new HashLongSet(CollectionUtils.comfortableCapacity(length));
|
||||
var set = new HashSetLong(CollectionUtils.comfortableCapacity(length));
|
||||
for (var i = 0; i < length; i++) {
|
||||
set.add(readLong(byteBuf));
|
||||
}
|
||||
|
||||
+4
-4
@@ -22,15 +22,15 @@ import java.util.Objects;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HashByteSet extends AbstractSet<Byte> {
|
||||
public class HashSetByte extends AbstractSet<Byte> {
|
||||
|
||||
private final ByteObjectHashMap<Object> map;
|
||||
|
||||
public HashByteSet() {
|
||||
public HashSetByte() {
|
||||
map = new ByteObjectHashMap<>();
|
||||
}
|
||||
|
||||
public HashByteSet(int initialCapacity) {
|
||||
public HashSetByte(int initialCapacity) {
|
||||
map = new ByteObjectHashMap<>(initialCapacity);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class HashByteSet extends AbstractSet<Byte> {
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
var obj = (HashByteSet) o;
|
||||
var obj = (HashSetByte) o;
|
||||
return Objects.equals(map, obj.map);
|
||||
}
|
||||
|
||||
+4
-4
@@ -22,15 +22,15 @@ import java.util.Objects;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HashIntSet extends AbstractSet<Integer> {
|
||||
public class HashSetInt extends AbstractSet<Integer> {
|
||||
|
||||
private final IntObjectHashMap<Object> map;
|
||||
|
||||
public HashIntSet() {
|
||||
public HashSetInt() {
|
||||
map = new IntObjectHashMap<>();
|
||||
}
|
||||
|
||||
public HashIntSet(int initialCapacity) {
|
||||
public HashSetInt(int initialCapacity) {
|
||||
map = new IntObjectHashMap<>(initialCapacity);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class HashIntSet extends AbstractSet<Integer> {
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
var obj = (HashIntSet) o;
|
||||
var obj = (HashSetInt) o;
|
||||
return Objects.equals(map, obj.map);
|
||||
}
|
||||
|
||||
+4
-4
@@ -22,15 +22,15 @@ import java.util.Objects;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HashLongSet extends AbstractSet<Long> {
|
||||
public class HashSetLong extends AbstractSet<Long> {
|
||||
|
||||
private final LongObjectHashMap<Object> map;
|
||||
|
||||
public HashLongSet() {
|
||||
public HashSetLong() {
|
||||
map = new LongObjectHashMap<>();
|
||||
}
|
||||
|
||||
public HashLongSet(int initialCapacity) {
|
||||
public HashSetLong(int initialCapacity) {
|
||||
map = new LongObjectHashMap<>(initialCapacity);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class HashLongSet extends AbstractSet<Long> {
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
var obj = (HashLongSet) o;
|
||||
var obj = (HashSetLong) o;
|
||||
return Objects.equals(map, obj.map);
|
||||
}
|
||||
|
||||
+4
-4
@@ -22,15 +22,15 @@ import java.util.Objects;
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HashShortSet extends AbstractSet<Short> {
|
||||
public class HashSetShort extends AbstractSet<Short> {
|
||||
|
||||
private final ShortObjectHashMap<Object> map;
|
||||
|
||||
public HashShortSet() {
|
||||
public HashSetShort() {
|
||||
map = new ShortObjectHashMap<>();
|
||||
}
|
||||
|
||||
public HashShortSet(int initialCapacity) {
|
||||
public HashSetShort(int initialCapacity) {
|
||||
map = new ShortObjectHashMap<>(initialCapacity);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class HashShortSet extends AbstractSet<Short> {
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
var obj = (HashShortSet) o;
|
||||
var obj = (HashSetShort) o;
|
||||
return Objects.equals(map, obj.map);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user