Class AbstractNamedList<T>

java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
org.olap4j.impl.AbstractNamedList<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>, SequencedCollection<T>, NamedList<T>

public abstract class AbstractNamedList<T> extends AbstractList<T> implements NamedList<T>
Partial implementation of NamedList.

Derived class must implement AbstractList.get(int) and AbstractCollection.size(), as per AbstractList; and must implement NamedList.getName(Object), to indicate how elements are named.

Since:
May 25, 2007
Author:
jhyde
See Also:
  • Constructor Details

    • AbstractNamedList

      public AbstractNamedList()
  • Method Details

    • get

      public T get(String name)
      Description copied from interface: NamedList
      Retrieves a member by name.
      Specified by:
      get in interface NamedList<T>
      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

      public int indexOfName(String name)
      Description copied from interface: NamedList
      Returns the position where a member of a given name is found, or -1 if the member is not present.
      Specified by:
      indexOfName in interface NamedList<T>
      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:
    • asMap

      public Map<String,T> asMap()
      Description copied from interface: NamedList
      Returns a view of this named list as a Map whose key is the name of each element.
      Specified by:
      asMap in interface NamedList<T>
      Returns:
      A view of this named list as a map