com.endeca.navigation
Class DimValIdList

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

public class DimValIdList
extends AbstractList
implements Serializable, List

Every dimension value (DimVal object) has a unique ID. A DimValIdList object contains a list of dimension value IDs. Typically, the developer does not create and populate the DimValIdList object, but instead it is returned by methods such as ENEQuery.getDimSearchDimensions(). Note that while DimValIdList objects are lists of dimension value IDs, DimValList objects are lists of the actual dimension values.

DimValIdList objects are primarily used to generate MDEX Engine queries. For example, dimension value IDs are used before executing a basic navigation query, as the input argument to the ENEQuery.setNavDescriptors(DimValIdList) method. There will be a one-to-one mapping between the IDs in the DimValIdList argument and the dimension values (DimVal objects) that are returned by the query.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DimValIdList()
          Default constructor that will contain an empty list.
DimValIdList(DimValList values)
          Constructor that takes a dimension value list and extracts the IDs from the DimVal objects in the list.
DimValIdList(String ids)
          Constructor that takes a string-based set of dimension value IDs, and parses and populates the list with the string.
 
Method Summary
 void addDimValue(DimVal val)
          Adds a dimension value ID to the DimValIdList list.
 void addDimValueId(long id)
          Adds a dimension value ID to the DimValIdList list.
 Object get(int index)
          Gets the element at position index.
 long getDimValueId(int i)
          Gets a dimension value ID from the DimValIdList object.
 Object remove(int index)
          Removes the element at the specified position in this list.
 int size()
          Returns the number of dimension value IDs in this list.
 String toString()
          Generates the string-based representation of the list by returning a space-delimited sequence of dimension value IDs.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
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, removeAll, retainAll, set, subList, toArray, toArray
 

Constructor Detail

DimValIdList

public DimValIdList()
Default constructor that will contain an empty list.


DimValIdList

public DimValIdList(String ids)
Constructor that takes a string-based set of dimension value IDs, and parses and populates the list with the string. The string must be a space-delimited sequence of unsigned integers.

Parameters:
ids - a space-delimited sequence of dimension value IDs.

DimValIdList

public DimValIdList(DimValList values)
Constructor that takes a dimension value list and extracts the IDs from the DimVal objects in the list.

Parameters:
values - DimValList object from which the IDs will be extracted.
Method Detail

addDimValueId

public void addDimValueId(long id)
Adds a dimension value ID to the DimValIdList list.

Parameters:
id - a dimension value ID to add to the list.

addDimValue

public void addDimValue(DimVal val)
Adds a dimension value ID to the DimValIdList list. The ID is extracted from val, which is a dimension value.

Parameters:
val - DimVal object from which the ID will be extracted.

getDimValueId

public long getDimValueId(int i)
Gets a dimension value ID from the DimValIdList object.

Returns:
The dimension value ID at position i.

remove

public Object remove(int index)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Specified by:
remove in interface List
Overrides:
remove in class AbstractList
Parameters:
index - The offset of the element in the list.
Returns:
element previously at position index.
Throws:
IndexOutOfBoundsException - If the index is out of range.

get

public Object get(int index)
Gets the element at position index. Object returned is of type Long. Use of this method is not recommended as object returned is of type Long. Interface present for List interface.

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

size

public int size()
Returns the number of dimension value IDs in this list.

Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection
Returns:
Number of elements in list.

toString

public String toString()
Generates the string-based representation of the list by returning a space-delimited sequence of dimension value IDs.

Overrides:
toString in class AbstractCollection
Returns:
a space-delimited sequence of dimension value IDs.


2010 Endeca Technologies, Inc.
Endeca Confidential