Class IDList

java.lang.Object
com.jme3.renderer.IDList

public class IDList extends Object
A specialized data-structure used to optimize state changes of "slot" based state.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The number of valid elements in the new list.
    int[]
    Indices belonging to the "new list".
    int
    The number of valid elements in the old list.
    int[]
    Indices belonging to the "old list".
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Copies the new list to the old list, and clears the new list.
    boolean
    moveToNew(int idx)
    Adds an index to the new list.
    void
    Prints the contents of the lists.
    void
    Resets all states to zero.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • newList

      public int[] newList
      Indices belonging to the "new list". Valid data in elements 0 through newLen-1 only!
    • oldList

      public int[] oldList
      Indices belonging to the "old list". Valid data in elements 0 through oldLen-1 only!
    • newLen

      public int newLen
      The number of valid elements in the new list.
    • oldLen

      public int oldLen
      The number of valid elements in the old list.
  • Constructor Details

    • IDList

      public IDList()
  • Method Details

    • reset

      public void reset()
      Resets all states to zero.
    • moveToNew

      public boolean moveToNew(int idx)
      Adds an index to the new list. If the index was not in the old list, false is returned, if the index was in the old list, it is removed from the old list and true is returned.
      Parameters:
      idx - The index to move
      Returns:
      True if it existed in old list and was removed from there, false otherwise.
    • copyNewToOld

      public void copyNewToOld()
      Copies the new list to the old list, and clears the new list.
    • print

      public void print()
      Prints the contents of the lists.