Package org.olap4j.impl
Class ArrayNamedListImpl<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<T>
org.olap4j.impl.ArrayNamedListImpl<T>
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
,SequencedCollection<T>
,NamedList<T>
- Direct Known Subclasses:
NamedListImpl
Implementation of
NamedList
which uses
ArrayList
for storage.
Derived class must implement NamedList.getName(Object)
, to indicate how
elements are named.
- Since:
- Nov 12, 2007
- Author:
- jhyde
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty list.ArrayNamedListImpl
(int initialCapacity) Creates an empty list with the specified initial capacity.ArrayNamedListImpl
(Collection<? extends T> c) Creates a list containing the elements of the specified collection, in the order they are returned by the collection's iterator. -
Method Summary
Modifier and TypeMethodDescriptionasMap()
Returns a view of this named list as aMap
whose key is the name of each element.Retrieves a member by name.int
indexOfName
(String name) Returns the position where a member of a given name is found, or -1 if the member is not present.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArray
-
Constructor Details
-
ArrayNamedListImpl
public ArrayNamedListImpl(int initialCapacity) Creates an empty list with the specified initial capacity.- Parameters:
initialCapacity
- the initial capacity of the list- Throws:
IllegalArgumentException
- if the specified initial capacity is negative
-
ArrayNamedListImpl
public ArrayNamedListImpl()Creates an empty list. -
ArrayNamedListImpl
Creates a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.- Parameters:
c
- the collection whose elements are to be placed into this list- Throws:
NullPointerException
- if the specified collection is null
-
-
Method Details
-
get
Description copied from interface:NamedList
Retrieves a member by name. -
indexOfName
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 interfaceNamedList<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
Description copied from interface:NamedList
Returns a view of this named list as aMap
whose key is the name of each element.
-