Class ObjectList

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class ObjectList
    extends AbstractObjectList
    A list of objects that can grow as required.

    When cloning, the objects in the list are NOT cloned, only the references.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectList()
      Default constructor.
      ObjectList​(int initialCapacity)
      Creates a new list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(int index)
      Returns the object at the specified index, if there is one, or null.
      int indexOf​(java.lang.Object object)
      Returns the index of the specified object, or -1 if the object is not in the list.
      void set​(int index, java.lang.Object object)
      Sets an object reference (overwriting any existing object).
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectList

        public ObjectList()
        Default constructor.
      • ObjectList

        public ObjectList​(int initialCapacity)
        Creates a new list.
        Parameters:
        initialCapacity - the initial capacity.
    • Method Detail

      • get

        public java.lang.Object get​(int index)
        Returns the object at the specified index, if there is one, or null.
        Overrides:
        get in class AbstractObjectList
        Parameters:
        index - the object index.
        Returns:
        The object or null.
      • set

        public void set​(int index,
                        java.lang.Object object)
        Sets an object reference (overwriting any existing object).
        Overrides:
        set in class AbstractObjectList
        Parameters:
        index - the object index.
        object - the object (null permitted).
      • indexOf

        public int indexOf​(java.lang.Object object)
        Returns the index of the specified object, or -1 if the object is not in the list.
        Overrides:
        indexOf in class AbstractObjectList
        Parameters:
        object - the object.
        Returns:
        The index or -1.