Class SimpleBitStorage
java.lang.Object
net.minecraft.util.SimpleBitStorage
- All Implemented Interfaces:
BitStorage
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final long[]private final intprivate final intprivate final intprivate static final int[]private final longprivate final intprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionSimpleBitStorage(int bits, int size) SimpleBitStorage(int bits, int size, int[] values) SimpleBitStorage(int bits, int size, long @Nullable [] data) -
Method Summary
Modifier and TypeMethodDescriptionprivate intcellIndex(int bitIndex) copy()intget(int index) Gets the entry at the given indexvoidgetAll(IntConsumer output) intgetAndSet(int index, int value) intgetBits()long[]getRaw()intgetSize()voidset(int index, int value) Sets the entry at the given location to the given valuevoidunpack(int[] output)
-
Field Details
-
MAGIC
private static final int[] MAGIC -
data
private final long[] data -
bits
private final int bits -
mask
private final long mask -
size
private final int size -
valuesPerLong
private final int valuesPerLong -
divideMul
private final int divideMul -
divideAdd
private final int divideAdd -
divideShift
private final int divideShift
-
-
Constructor Details
-
SimpleBitStorage
public SimpleBitStorage(int bits, int size, int[] values) -
SimpleBitStorage
public SimpleBitStorage(int bits, int size) -
SimpleBitStorage
public SimpleBitStorage(int bits, int size, long @Nullable [] data)
-
-
Method Details
-
cellIndex
private int cellIndex(int bitIndex) -
getAndSet
public int getAndSet(int index, int value) - Specified by:
getAndSetin interfaceBitStorage
-
set
public void set(int index, int value) Description copied from interface:BitStorageSets the entry at the given location to the given value- Specified by:
setin interfaceBitStorage
-
get
public int get(int index) Description copied from interface:BitStorageGets the entry at the given index- Specified by:
getin interfaceBitStorage
-
getRaw
public long[] getRaw()- Specified by:
getRawin interfaceBitStorage
-
getSize
public int getSize()- Specified by:
getSizein interfaceBitStorage
-
getBits
public int getBits()- Specified by:
getBitsin interfaceBitStorage
-
getAll
- Specified by:
getAllin interfaceBitStorage
-
unpack
public void unpack(int[] output) - Specified by:
unpackin interfaceBitStorage
-
copy
- Specified by:
copyin interfaceBitStorage
-