Type Parameters:
T - Actual Item Type
All Superinterfaces:
Collection<T>, Iterable<T>, List<T>
All Known Subinterfaces:
ItemList
All Known Implementing Classes:
ItemListBaseImpl, ItemListImpl

public interface ItemListBase<T extends SimpleItem> extends List<T>
This Interface derives from the standard List interface. It Represents a List of anything extending ItemBase Interface. The concrete type can be specified via generics. In addition to the standard List interface it provides additional get,remove and contains methods using the techKey or the item handle as identifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(TechKey techKey)
    Returns true if this list contains an element with the given technical key

    Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
    boolean
    contains(String handle)
    Returns true if this list contains an element with the given handle

    Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
    get(TechKey techKey)
    Returns the item specified by the given technical key.

    Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
    get(String handle)
    Returns the item specified by the given handle.

    Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
    int
    indexOf(TechKey techKey)
    Returns the index for the item with the given key.

    Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
    int
    indexOf(String handle)
    Returns the index for the item with the given handle.
    Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
    boolean
    remove(TechKey techKey)
    Remove the given element from this list, if it exists.

    Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
    boolean
    remove(String handle)
    Remove the given element from this list, if it exists.

    Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, stream, toArray

    Methods inherited from interface java.lang.Iterable

    forEach
  • Method Details

    • contains

      boolean contains(String handle)
      Returns true if this list contains an element with the given handle

      Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
      Parameters:
      handle - handle to search for
      Returns:
      true if this list contains an element with the given handle
    • contains

      boolean contains(TechKey techKey)
      Returns true if this list contains an element with the given technical key

      Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
      Parameters:
      techKey - techKey to search for
      Returns:
      true if this list contains an element with the given technical key
    • get

      T get(String handle)
      Returns the item specified by the given handle.

      Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
      Parameters:
      handle - the handle of the item that should be retrieved
      Returns:
      the item with the given handle or null if no item for that key was found.
    • get

      T get(TechKey techKey)
      Returns the item specified by the given technical key.

      Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
      Parameters:
      techKey - the technical key of the item that should be retrieved
      Returns:
      the item with the given techical key or null if no item for that key was found.
    • indexOf

      int indexOf(String handle)
      Returns the index for the item with the given handle.
      Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
      Parameters:
      handle - item handle
      Returns:
      index in the item list, or -1 if such an element does not exists.
    • indexOf

      int indexOf(TechKey techKey)
      Returns the index for the item with the given key.

      Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
      Parameters:
      techKey - item key
      Returns:
      index in the item list, or -1 if such an element does not exists.
    • remove

      boolean remove(String handle)
      Remove the given element from this list, if it exists.

      Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
      Parameters:
      handle - of element to remove from the list
      Returns:
      true if this list contained the specified element
    • remove

      boolean remove(TechKey techKey)
      Remove the given element from this list, if it exists.

      Note - This implementation assumes that the list is small and performs a simple search running in the list from the first element to the last.
      Parameters:
      techKey - index of element to remove from the list
      Returns:
      true if this list contained the specified element