Interface ItemListBase<T extends SimpleItem>

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

    public interface ItemListBase<T extends SimpleItem>
    extends java.util.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

      All Methods Instance Methods Abstract Methods 
      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​(java.lang.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.
      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.
      T get​(java.lang.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​(java.lang.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​(java.lang.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
      • Methods inherited from interface java.util.List

        add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
    • Method Detail

      • contains

        boolean contains​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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