Class SavotSet<E>

    • Constructor Summary

      Constructors 
      Constructor Description
      SavotSet()
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addItem​(E item)
      Add an item to the set
      void ensureCapacity​(int minCapacity)
      Increases the capacity of this SavotSet instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
      E getItemAt​(int index)
      Get an item at a given position (index)
      int getItemCount()
      Get the number of items
      java.util.List<E> getItems()
      Get the whole set
      void removeAllItems()
      Remove all items
      void removeItemAt​(int index)
      Remove an item at a given position (index)
      void setItems​(java.util.ArrayList<E> set)
      Set the whole set to a given set
      void trim()
      Trims the capacity of this SavotSet instance to be the list's current size.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SavotSet

        public SavotSet()
        Constructor
    • Method Detail

      • addItem

        public final void addItem​(E item)
        Add an item to the set
        Parameters:
        item -
      • getItemAt

        public final E getItemAt​(int index)
        Get an item at a given position (index)
        Parameters:
        index -
        Returns:
        Object
      • removeItemAt

        public final void removeItemAt​(int index)
        Remove an item at a given position (index)
        Parameters:
        index -
      • removeAllItems

        public final void removeAllItems()
        Remove all items
      • setItems

        public final void setItems​(java.util.ArrayList<E> set)
        Set the whole set to a given set
        Parameters:
        set -
      • getItems

        public final java.util.List<E> getItems()
        Get the whole set
        Returns:
        a ArrayList
      • getItemCount

        public final int getItemCount()
        Get the number of items
        Returns:
        int
      • ensureCapacity

        public final void ensureCapacity​(int minCapacity)
        Increases the capacity of this SavotSet instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument.
        Parameters:
        minCapacity - the desired minimum capacity
      • trim

        public final void trim()
        Trims the capacity of this SavotSet instance to be the list's current size. An application can use this operation to minimize the storage of an SavotSet instance.