Interface NamedList<E>

All Superinterfaces:
Collection<E>, Iterable<E>, List<E>, SequencedCollection<E>
All Known Implementing Classes:
AbstractNamedList, ArrayNamedListImpl, NamedListImpl

public interface NamedList<E> extends List<E>
Extension to List which allows access to members of the list by name as well as by ordinal.
Since:
Aug 22, 2006
Author:
jhyde
  • Method Details

    • get

      E get(String name)
      Retrieves a member by name.
      Parameters:
      name - name of the element to return
      Returns:
      the element of the list with the specified name, or null if there is no such element
      See Also:
    • indexOfName

      int indexOfName(String name)
      Returns the position where a member of a given name is found, or -1 if the member is not present.
      Parameters:
      name - name of the element to return
      Returns:
      the index of element of the list with the specified name, or -1 if there is no such element
      See Also:
    • getName

      String getName(Object element)
      Returns the name of a given element.
      Parameters:
      element - Element
      Returns:
      Name of element
    • asMap

      Map<String,E> asMap()
      Returns a view of this named list as a Map whose key is the name of each element.
      Returns:
      A view of this named list as a map