com.endeca.navigation
Class DimensionList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by com.endeca.navigation.DimensionList
All Implemented Interfaces:
Iterable, Collection, List

public class DimensionList
extends AbstractList
implements List

List of dimensions (Dimension objects).

Note: DimensionList objects are unmodifiable and therefore do not support any modification operations (such as add, remove, and clear) that are inherited. Attempting to modify the object may result in a runtime exception (UnsupportedOperationException).


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Method Summary
 Object get(int index)
          Gets the Dimension at index index.
 Dimension getDimension(long dimensionId)
          Gets the dimension with the ID dimensionId from this list.
 Dimension getDimension(String dimensionName)
          Gets the dimension with the name dimensionName from this list.
 int size()
          Returns the number of dimensions in this list.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray
 

Method Detail

size

public int size()
Returns the number of dimensions in this list.

Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection
Returns:
Number of encapsulated dimensions.

get

public Object get(int index)
Gets the Dimension at index index. If index is less than 0 or greater than or equal to the size of the list, throws ArrayIndexOutOfBoundsException.

Specified by:
get in interface List
Specified by:
get in class AbstractList
Parameters:
index - offset of the desired dimension.
Returns:
The Dimension at index index.
Throws:
ArrayIndexOutOfBoundsException - Index out of range.

getDimension

public Dimension getDimension(long dimensionId)
Gets the dimension with the ID dimensionId from this list. If the dimension is not found in this list null is returned.

Note that when dealing with multi-select dimensions, it is possible for the list to have multiple Dimension objects for the same dimension. In this case, several share the same ID and this method does not define which one is returned.

Parameters:
dimensionId - ID of the desired dimension.
Returns:
Dimension with the ID dimensionId or null if the dimension is not found.

getDimension

public Dimension getDimension(String dimensionName)
Gets the dimension with the name dimensionName from this list. If the dimension is not found in this list, null is returned.

Note that if several dimensions share the same name, this method does not define which one is returned.

Parameters:
dimensionName - name of the desired dimension.
Returns:
Dimension with the name dimensionName or null if the dimension is not found.


2010 Endeca Technologies, Inc.
Endeca Confidential