Class IndexBufferData<T extends Buffer>

java.lang.Object
com.ardor3d.scenegraph.AbstractBufferData<T>
com.ardor3d.scenegraph.IndexBufferData<T>
Direct Known Subclasses:
ByteBufferData, IntBufferData, ShortBufferData

public abstract class IndexBufferData<T extends Buffer> extends AbstractBufferData<T>
  • Constructor Details

    • IndexBufferData

      public IndexBufferData()
  • Method Details

    • get

      public abstract int get()
      Returns:
      the next value from this object, as an int, incrementing our position by 1 entry. Buffer types smaller than an int should return unsigned values.
    • get

      public abstract int get(int index)
      Parameters:
      index - the absolute position to get our value from. This is in entries, not bytes, and is 0 based. So for a ShortBuffer, 2 would be the 3rd short from the beginning, etc.
      Returns:
      the value from this object, as an int, at the given absolute entry position. Buffer types smaller than an int should return unsigned values.
    • asIntBuffer

      public abstract IntBuffer asIntBuffer()
      Returns:
      a new, non-direct IntBuffer containing a snapshot of the contents of this buffer.
    • put

      public abstract IndexBufferData<T> put(int value)
      Sets the value of this buffer at the current position, incrementing our position by 1 entry.
      Parameters:
      value - the value to place into this object at the current position.
      Returns:
      this object, for chaining.
    • put

      public abstract IndexBufferData<T> put(int index, int value)
      Sets the value of this buffer at the given index.
      Parameters:
      index - the absolute position to put our value at. This is in entries, not bytes, and is 0 based. So for a ShortBuffer, 2 would be the 3rd short from the beginning, etc.
      value - the value to place into this object
      Returns:
      this object, for chaining.
    • put

      public abstract void put(IndexBufferData<?> buf)
      Write the contents of the given IndexBufferData into this one. Note that data conversion is handled using the get/put methods in IndexBufferData.
      Parameters:
      buf - the source buffer object.
    • put

      public abstract void put(int[] array)
      Write the contents of the given int array into this IndexBufferData. Note that data conversion is handled using the get/put methods in IndexBufferData.
      Parameters:
      array - the source int array.
    • put

      public abstract void put(int[] array, int offset, int length)
      Write the contents of the given int array into this IndexBufferData. Note that data conversion is handled using the get/put methods in IndexBufferData.
      Parameters:
      array - the source int array.
      offset - the offset
      length - the length
    • getBuffer

      public abstract T getBuffer()
      Get the underlying nio buffer.
      Overrides:
      getBuffer in class AbstractBufferData<T extends Buffer>
      Returns:
      the buffer
    • remaining

      public int remaining()
      Returns:
      The number of elements remaining in this buffer
      See Also:
    • position

      public int position()
      Returns:
      The position of this buffer
      See Also:
    • position

      public void position(int position)
      Parameters:
      position - The new position value; must be non-negative and no larger than the current limit
      See Also:
    • limit

      public int limit()
      Returns:
      The limit of this buffer
      See Also:
    • limit

      public void limit(int limit)
      Parameters:
      limit - The new limit value; must be non-negative and no larger than this buffer's capacity
      See Also:
    • capacity

      public int capacity()
      Returns:
      The capacity of this buffer
      See Also:
    • rewind

      public void rewind()
      See Also:
    • flip

      public void flip()
      See Also:
    • clear

      public void clear()
      See Also:
    • reset

      public void reset()
      See Also:
    • makeCopy

      public abstract IndexBufferData<T> makeCopy()
      Specified by:
      makeCopy in class AbstractBufferData<T extends Buffer>
      Returns:
      a deep copy of this buffer data object