All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public final class SStrandList extends Array<SStrand>
A variable-length list (array) of hair strands. (native type: Array<HairSettings::SStrand>)
  • Constructor Details

    • SStrandList

      public SStrandList()
      Instantiate an empty list.
    • SStrandList

      public SStrandList(SStrand... strands)
      Instantiate a list from a fixed-length array.
      Parameters:
      strands - the strands to include in the list
  • Method Details

    • capacity

      public int capacity()
      Count how many strands the currently allocated storage can hold. The list is unaffected.
      Specified by:
      capacity in class Array<SStrand>
      Returns:
      the number of strands (≥size)
    • erase

      public void erase(int startIndex, int stopIndex)
      Remove all strands in the specified range of indices.
      Specified by:
      erase in class Array<SStrand>
      Parameters:
      startIndex - the index of the first strand to remove (≥0)
      stopIndex - one plus the index of the last strand to remove (≥0)
    • get

      public SStrand get(int elementIndex)
      Access the strand at the specified index.
      Specified by:
      get in class Array<SStrand>
      Parameters:
      elementIndex - the index from which to get the strand (≥0)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • resize

      public void resize(int numStrands)
      Extend or truncate the list.
      Specified by:
      resize in class Array<SStrand>
      Parameters:
      numStrands - the desired size (number of strands, ≥0)
    • set

      public void set(int elementIndex, SStrand strand)
      Put the specified strand at the specified index.
      Specified by:
      set in class Array<SStrand>
      Parameters:
      elementIndex - the index at which to put the strand (≥0)
      strand - the strand to put (not null)
    • size

      public int size()
      Count how many strands are in the list. The list is unaffected.
      Specified by:
      size in class Array<SStrand>
      Returns:
      the number of strands (≥0, ≤capacity)