Package de.linusdev.lutils.struct.array
Class StructureArray<T extends Structure>
java.lang.Object
de.linusdev.lutils.struct.abstracts.Structure
de.linusdev.lutils.struct.mod.ModTrackingStructure
de.linusdev.lutils.struct.array.StructureArray<T>
- All Implemented Interfaces:
MemorySizeable,NativeParsable,NativeArray<T>,Iterable<T>
@StructureSettings(requiresCalculateInfoMethod=true,
requiresFixedLengthAnnotation=true)
public class StructureArray<T extends Structure>
extends ModTrackingStructure
implements NativeArray<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfaceStructureArray.ElementCreator<T extends Structure>Nested classes/interfaces inherited from class de.linusdev.lutils.struct.mod.ModTrackingStructure
ModTrackingStructure.ModificationsHandler -
Field Summary
FieldsFields inherited from class de.linusdev.lutils.struct.mod.ModTrackingStructure
modificationLock, modificationSplitOffset, modInfo, trackModificationsFields inherited from class de.linusdev.lutils.struct.abstracts.Structure
byteBuf, modified, mostParentStructure, offset -
Constructor Summary
ConstructorsConstructorDescriptionStructureArray(boolean allocateBuffer, boolean trackModifications, @NotNull Class<T> elementClass, int size, @NotNull StructureArray.ElementCreator<T> creator) -
Method Summary
Modifier and TypeMethodDescriptionget(int index) GetNativeArraywith atindex@NotNull ArrayStructureInfogetInfo()getOrCreate(int index) intlength()voidSets givenNativeArrayat index.toString()protected voidSet thisStructureto be a child ofmostParentStructure.Methods inherited from class de.linusdev.lutils.struct.mod.ModTrackingStructure
claimBuffer, getFirstModificationInfo, handleModifications, onModification, tracksModificationsMethods inherited from class de.linusdev.lutils.struct.abstracts.Structure
allocate, callUseBufferOf, generateStructCode, getAlignment, getByteBuffer, getMostParentStructure, getOffset, getRequiredSize, isInitialised, isModified, modified, modified, toString, unmodifiedMethods 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.array.NativeArray
iteratorMethods inherited from interface de.linusdev.lutils.struct.abstracts.NativeParsable
getByteBuffer, getPointer, isInitialised
-
Field Details
-
GENERATOR
-
-
Constructor Details
-
StructureArray
public StructureArray(boolean allocateBuffer, boolean trackModifications, @NotNull @NotNull Class<T> elementClass, int size, @NotNull @NotNull StructureArray.ElementCreator<T> creator)
-
-
Method Details
-
set
Description copied from interface:NativeArraySets givenNativeArrayat index.- Specified by:
setin interfaceNativeArray<T extends Structure>- Parameters:
index- index to set. Must be greater than 0 and smaller thenNativeArray.length().struct- to set at index
-
useBuffer
Description copied from class:StructureSet thisStructureto be a child ofmostParentStructure.- Overrides:
useBufferin classModTrackingStructure- Parameters:
mostParentStructure- most parental structureoffset- start of this structure
-
length
public int length()- Specified by:
lengthin interfaceNativeArray<T extends Structure>- Returns:
- length of this array.
-
getOrCreate
- See Also:
-
get
Description copied from interface:NativeArrayGetNativeArraywith atindex- Specified by:
getin interfaceNativeArray<T extends Structure>- Parameters:
index- index to get from. Must be greater than 0 and smaller thenNativeArray.length().- Returns:
NativeArrayatindex
-
getInfo
-
toString
-