java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Array<ConstraintRef>
com.github.stephengold.joltjni.Constraints
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
A variable-length array of references to constraints. (native type:
Array<Ref<Constraint>>)-
Method Summary
Modifier and TypeMethodDescriptionintcapacity()Count how many references the currently allocated storage can hold.voiderase(int startIndex, int stopIndex) Remove all references in the specified range of indices.get(int elementIndex) Copy the reference at the specified index.voidresize(int numReferences) Expand or truncate the array.voidset(int elementIndex, ConstraintRef reference) Duplicate the specified reference at the specified index.intsize()Count how many references are in the array.Methods inherited from class com.github.stephengold.joltjni.template.Array
clear, empty, erase, pushBack, toListMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
capacity
public int capacity()Count how many references the currently allocated storage can hold. The array is unaffected.- Specified by:
capacityin classArray<ConstraintRef>- Returns:
- the number of references (≥size)
-
erase
public void erase(int startIndex, int stopIndex) Remove all references in the specified range of indices.- Specified by:
erasein classArray<ConstraintRef>- Parameters:
startIndex- the index of the first element to remove (≥0)stopIndex- one plus the index of the last element to remove (≥0)
-
get
Copy the reference at the specified index.- Specified by:
getin classArray<ConstraintRef>- Parameters:
elementIndex- the index from which to get the reference (≥0)- Returns:
- a new reference to the same constraint
-
resize
public void resize(int numReferences) Expand or truncate the array.- Specified by:
resizein classArray<ConstraintRef>- Parameters:
numReferences- the desired size (number of references, ≥0)
-
set
Duplicate the specified reference at the specified index.- Specified by:
setin classArray<ConstraintRef>- Parameters:
elementIndex- the index at which to put the reference (≥0)reference- the reference to put (not null)
-
size
public int size()Count how many references are in the array. The array is unaffected.- Specified by:
sizein classArray<ConstraintRef>- Returns:
- the number of references (≥0, ≤capacity)
-