Package georegression.struct.packed
Interface PackedArray<T>
- All Superinterfaces:
LArrayAccessor<T>
- All Known Implementing Classes:
PackedArray_F32,PackedArray_F64,PackedArrayPoint2D_F32,PackedArrayPoint2D_F64,PackedArrayPoint2D_I16,PackedArrayPoint2D_I32,PackedArrayPoint3D_F32,PackedArrayPoint3D_F64,PackedArrayPoint4D_F32,PackedArrayPoint4D_F64,PackedBigArray_F32,PackedBigArray_F64,PackedBigArrayPoint2D_F32,PackedBigArrayPoint2D_F64,PackedBigArrayPoint3D_F32,PackedBigArrayPoint3D_F64,PackedBigArrayPoint4D_F32,PackedBigArrayPoint4D_F64
Interface for objects which are stored in a dense array instead as individual elements. This is typically
implemented internally as a structure of array format.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends a copy to the end of the arrayvoidforIdx(int idx0, int idx1, PackedArray.ProcessIndex<T> op) Passes in each object and index within the specified range.booleanisEquals(PackedArray<T> other) Checks to see if the two data structures are equalvoidremoveSwap(int index) Removes the index and copies in the last element.reserve(int numElements) Ensure there is enough space to store 'numElements' before the internal array needs to grow.reset()Resets the array's size to be zerovoidresize(int size) Resizes the array.voidSets an element's valueMethods inherited from interface org.ddogleg.struct.LArrayAccessor
copy, getCopy, getElementType, getTemp, isEmpty, isNotEmpty, size
-
Method Details
-
reset
PackedArray<T> reset()Resets the array's size to be zero- Returns:
- An instance of 'this' for chaining
-
resize
void resize(int size) Resizes the array. If the size has increased then new elements are given the default value -
removeSwap
void removeSwap(int index) Removes the index and copies in the last element. O(1), but changes the order -
reserve
Ensure there is enough space to store 'numElements' before the internal array needs to grow. Does not change the size- Parameters:
numElements- Minimum number of elements allocated to the array- Returns:
- An instance of 'this' for chaining
-
append
Appends a copy to the end of the array- Parameters:
element- (Input) The element which is copied then added
-
set
Sets an element's value -
forIdx
Passes in each object and index within the specified range. Modifications to the passed in objcet will be saved in the array.- Parameters:
idx0- Initial index. Inclusiveidx1- Last index, Exclusiveop- The operation to process each element
-
isEquals
Checks to see if the two data structures are equal
-