Class LookupList

java.lang.Object
generalDatabase.lookupTables.LookupList
All Implemented Interfaces:
Serializable, Cloneable, ManagedParameters

public class LookupList extends Object implements Cloneable, Serializable, ManagedParameters
Handles information for a single list from the look up table
Author:
Doug Gillespie
See Also:
  • Field Details

  • Constructor Details

    • LookupList

      public LookupList(String listTopic)
  • Method Details

    • getList

      public Vector<LookupItem> getList()
      Returns:
      the full list of LookupItems, including ones which are not currently selectable
    • getLutList

      public Vector<LookupItem> getLutList()
      This method was added only so that lutList will be automatically added to PamParameterSet in the getParameterSet method
      Returns:
    • getSelectedList

      public Vector<LookupItem> getSelectedList()
      Returns:
      the partial list of LookupItems, currently marked as selectable
    • addItem

      public void addItem(LookupItem lutItem)
      Add an item to the list
      Parameters:
      lutItem - item to add to the list
    • removeItem

      public boolean removeItem(LookupItem lutItem)
      Remove the first occurrence of an item from the list
      Parameters:
      lutItem - item to remove from the list
      Returns:
      true if the item was found and removed.
    • removeItem

      public LookupItem removeItem(int lutItemIndex)
      Remove an item at a specified index in the list
      Parameters:
      lutItemIndex - index of item to remove
      Returns:
      the removed item
    • sortItemsById

      public void sortItemsById()
      Sort the items by the database id value
    • sortItemsByOrder

      public void sortItemsByOrder()
      Sort the items by the order value in the look up table
    • sortItemsByCode

      public void sortItemsByCode()
      Sort the items by the code value in the look up table (case insensitive)
    • sortItemsByText

      public void sortItemsByText()
      Sort the items by the text value in the look up table (case insensitive)
    • setListTopic

      public void setListTopic(String listTopic)
    • getListTopic

      public String getListTopic()
    • checkRepeatCodes

      public String checkRepeatCodes()
      Check for repeated codes
      Returns:
      null if there are no repeats or the repeated code if it's repeated.
    • findSpeciesCode

      public LookupItem findSpeciesCode(String code)
      Find the lookup item for a specified code.
      Parameters:
      code - given code
      Returns:
      matching lookup item (case sensitive)
    • indexOfCode

      public int indexOfCode(String code)
      Parameters:
      code - species code.
      Returns:
      the index of a code.
    • getLookupItem

      public LookupItem getLookupItem(int index)
      Get a lookup item as a specified index
      Parameters:
      index - index of item
      Returns:
      lookup item
    • getDeletedItems

      public Vector<LookupItem> getDeletedItems()
      Returns:
      the deletedItems
    • getParameterSet

      public PamParameterSet getParameterSet()
      Description copied from interface: ManagedParameters
      Get a set of data that describes all of the parameters in a class
      Specified by:
      getParameterSet in interface ManagedParameters
      Returns:
      description of the parameters in a class.