Class MappableInfoList<T extends HasName>

Type Parameters:
T - the element type
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess
Direct Known Subclasses:
AnnotationInfoList, AnnotationParameterValueList, ClassInfoList, FieldInfoList, ModuleInfoList, PackageInfoList

public class MappableInfoList<T extends HasName> extends InfoList<T>
A list of named objects that can be indexed by name.
See Also:
  • Method Details

    • asMap

      public Map<String,T> asMap()
      Get an index for this list, as a map from the name of each list item (obtained by calling getName() on each list item) to the list item.
      Returns:
      An index for this list, as a map from the name of each list item (obtained by calling getName() on each list item) to the list item.
    • containsName

      public boolean containsName(String name)
      Check if this list contains an item with the given name.
      Parameters:
      name - The name to search for.
      Returns:
      true if this list contains an item with the given name.
    • get

      public T get(String name)
      Get the list item with the given name, or null if not found.
      Parameters:
      name - The name to search for.
      Returns:
      The list item with the given name, or null if not found.
    • add

      public boolean add(T element)
      Specified by:
      add in interface Collection<T>
      Specified by:
      add in interface List<T>
      Overrides:
      add in class ArrayList<T>
    • add

      public void add(int index, T element)
      Specified by:
      add in interface List<T>
      Overrides:
      add in class ArrayList<T>
    • remove

      public boolean remove(Object o)
      Specified by:
      remove in interface Collection<T>
      Specified by:
      remove in interface List<T>
      Overrides:
      remove in class ArrayList<T>
    • remove

      public T remove(int index)
      Specified by:
      remove in interface List<T>
      Overrides:
      remove in class ArrayList<T>
    • addAll

      public boolean addAll(Collection<? extends T> c)
      Specified by:
      addAll in interface Collection<T>
      Specified by:
      addAll in interface List<T>
      Overrides:
      addAll in class ArrayList<T>
    • addAll

      public boolean addAll(int index, Collection<? extends T> c)
      Specified by:
      addAll in interface List<T>
      Overrides:
      addAll in class ArrayList<T>
    • removeAll

      public boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<T>
      Specified by:
      removeAll in interface List<T>
      Overrides:
      removeAll in class ArrayList<T>
    • retainAll

      public boolean retainAll(Collection<?> c)
      Specified by:
      retainAll in interface Collection<T>
      Specified by:
      retainAll in interface List<T>
      Overrides:
      retainAll in class ArrayList<T>
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<T>
      Specified by:
      clear in interface List<T>
      Overrides:
      clear in class ArrayList<T>
    • set

      public T set(int index, T element)
      Specified by:
      set in interface List<T>
      Overrides:
      set in class ArrayList<T>
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Collection<T>
      Specified by:
      iterator in interface Iterable<T>
      Specified by:
      iterator in interface List<T>
      Overrides:
      iterator in class ArrayList<T>
    • listIterator

      public ListIterator<T> listIterator()
      Specified by:
      listIterator in interface List<T>
      Overrides:
      listIterator in class ArrayList<T>