Package de.linusdev.lutils.struct.array
Class PrimitiveTypeArray<T>
java.lang.Object
de.linusdev.lutils.struct.abstracts.Structure
de.linusdev.lutils.struct.array.PrimitiveTypeArray<T>
- All Implemented Interfaces:
MemorySizeable,NativeParsable,NativeArray<T>,Iterable<T>
@StructureSettings(requiresCalculateInfoMethod=true,
requiresFixedLengthAnnotation=true)
public class PrimitiveTypeArray<T>
extends Structure
implements NativeArray<T>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull PrimitiveTypeArray.PrimitiveArrayStaticGeneratorFields inherited from class de.linusdev.lutils.struct.abstracts.Structure
byteBuf, modified, mostParentStructure, offset -
Constructor Summary
ConstructorsConstructorDescriptionPrimitiveTypeArray(@NotNull Class<T> type, int size, boolean allocateBuffer) -
Method Summary
Modifier and TypeMethodDescriptionget(int index) GetNativeArraywith atindexbytegetByte(int index) doublegetDouble(int index) floatgetFloat(int index) @NotNull StructureInfogetInfo()intgetInt(int index) longgetLong(int index) shortgetShort(int index) iterator()intlength()voidSets givenNativeArrayat index.voidsetByte(int index, byte value) voidsetDouble(int index, double value) voidsetFloat(int index, float value) voidsetInt(int index, int value) voidsetLong(int index, long value) voidsetShort(int index, short value) intsize()toString()Methods inherited from class de.linusdev.lutils.struct.abstracts.Structure
allocate, callUseBufferOf, claimBuffer, generateStructCode, getAlignment, getByteBuffer, getMostParentStructure, getOffset, getRequiredSize, isInitialised, isModified, modified, modified, onModification, toString, unmodified, useBufferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface de.linusdev.lutils.struct.abstracts.MemorySizeable
getAlignment, getRequiredSizeMethods inherited from interface de.linusdev.lutils.struct.abstracts.NativeParsable
getByteBuffer, getPointer, isInitialised
-
Field Details
-
GENERATOR
-
-
Constructor Details
-
PrimitiveTypeArray
-
-
Method Details
-
get
Description copied from interface:NativeArrayGetNativeArraywith atindex- Specified by:
getin interfaceNativeArray<T>- Parameters:
index- index to get from. Must be greater than 0 and smaller thenNativeArray.length().- Returns:
NativeArrayatindex
-
set
Description copied from interface:NativeArraySets givenNativeArrayat index.- Specified by:
setin interfaceNativeArray<T>- Parameters:
index- index to set. Must be greater than 0 and smaller thenNativeArray.length().value- to set at index
-
length
public int length()- Specified by:
lengthin interfaceNativeArray<T>- Returns:
- length of this array.
-
getInt
public int getInt(int index) -
getFloat
public float getFloat(int index) -
getDouble
public double getDouble(int index) -
getLong
public long getLong(int index) -
getShort
public short getShort(int index) -
getByte
public byte getByte(int index) -
setInt
public void setInt(int index, int value) -
setFloat
public void setFloat(int index, float value) -
setDouble
public void setDouble(int index, double value) -
setLong
public void setLong(int index, long value) -
setShort
public void setShort(int index, short value) -
setByte
public void setByte(int index, byte value) -
size
public int size() -
iterator
-
getInfo
-
toString
-