Package snap.util

Class ObjectArray<T>

java.lang.Object
snap.util.ObjectArray<T>
All Implemented Interfaces:
Cloneable

public class ObjectArray<T> extends Object implements Cloneable
This class manages an array of object values.
  • Field Details

    • _array

      protected T[] _array
    • _length

      protected int _length
  • Constructor Details

    • ObjectArray

      public ObjectArray(Class<T> aClass)
      Constructor.
    • ObjectArray

      public ObjectArray(T[] anArray)
      Constructor.
  • Method Details

    • length

      public final int length()
      Returns the length.
    • setLength

      public void setLength(int aValue)
      Sets the length.
    • get

      public T get(int anIndex)
      Returns the Object value at index.
    • set

      public void set(T aValue, int anIndex)
      Sets the String value at index.
    • add

      public void add(T aValue)
      Adds the value at index.
    • add

      public void add(T aValue, int anIndex)
      Adds the value at index.
    • removeIndex

      public void removeIndex(int anIndex)
      Removes the float value at index.
    • getArray

      public T[] getArray()
      Returns the simple array (trimmed to length).
    • getLast

      public T getLast()
      Returns the last item.
    • getComponentClass

      public Class<T> getComponentClass()
      Returns the component class.
    • clone

      protected ObjectArray<T> clone()
      Standard clone implementation.
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Standard toString implementation.
      Overrides:
      toString in class Object
    • toStringProps

      public String toStringProps()
      Standard toStringProps implementation.