Class SavotSet<E>

java.lang.Object
cds.savot.model.SavotSet<E>
Type Parameters:
E - element type
Direct Known Subclasses:
CoosysSet, DefinitionsSet, DescriptionSet, FieldRefSet, FieldSet, GroupSet, InfoSet, LinkSet, OptionSet, ParamRefSet, ParamSet, ResourceSet, TableSet, TDSet, TRSet

public class SavotSet<E> extends Object

Generic class for other set classes

Author:
Andre Schaaff
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    addItem(E item)
    Add an item to the set
    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.
    final E
    getItemAt(int index)
    Get an item at a given position (index)
    final int
    Get the number of items
    final List<E>
    Get the whole set
    final void
    Remove all items
    final void
    removeItemAt(int index)
    Remove an item at a given position (index)
    final void
    Set the whole set to a given set
    final void
    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 Details

    • SavotSet

      public SavotSet()
      Constructor
  • Method Details

    • 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(ArrayList<E> set)
      Set the whole set to a given set
      Parameters:
      set -
    • getItems

      public final 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.