com.endeca.navigation
Class DimGroup

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

public class DimGroup
extends AbstractList
implements List

Class encapsulating a group of dimensions. Dimension groups provide a way to impose relationships on dimensions (Dimension objects). By creating a dimension group, dimensions can be organized for presentation purposes. Each explicit dimension group must be given a name; a unique ID is generated when the data is indexed.

If a dimension is not assigned to an explicit dimension group, it is placed in an implicit dimension group of its own. These implicit groups have no name and an ID of zero.

Note: DimGroup 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 position index in the list.
 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.
 long getId()
          Gets the ID of the dimension group.
 String getName()
          Gets the name of the dimension group.
 boolean isExplicit()
          Determines if the dimension group is an explicit or implicit dimension group.
 int size()
          Gets the number of dimensions enclosed by this dimension group.
 
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

get

public Object get(int index)
Gets the dimension at position index in the list. The Object is a Dimension object.

Specified by:
get in interface List
Specified by:
get in class AbstractList
Parameters:
index - offset of the desired dimension.
Returns:
Dimension at position index.
Throws:
IndexOutOfBoundsException - If the index is out of range.

size

public int size()
Gets the number of dimensions enclosed by this dimension group.

Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection
Returns:
Number of dimensions enclosed by this DimGroup.

getName

public String getName()
Gets the name of the dimension group.

Returns:
Name of the dimension group. Returns null if it does not have a name (i.e., is an implicit dimension group).

getId

public long getId()
Gets the ID of the dimension group.

Returns:
ID of the dimension group. Returns 0 if it is an implicit dimension group.

isExplicit

public boolean isExplicit()
Determines if the dimension group is an explicit or implicit dimension group.

Returns:
true if the dimension group is an explicit dimension; false if it is an implicit dimension group.

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 to have a list with 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 - the 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. Several dimensions may share the same name in the list, and in this case this method does not define which one is returned.

Parameters:
dimensionName - the 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