com.endeca.navigation
Class ERecIdList

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

public class ERecIdList
extends AbstractList
implements Serializable, List

List of record specifications. Primarily used to generate URLs and MDEX Engine queries.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ERecIdList()
          Default constructor.
ERecIdList(long erecId)
          Deprecated. This method may not be supported in future versions of the MDEX Engine API - use ERecIdList(String) instead. Constructor that takes a single id and makes a record id list with only one element.
ERecIdList(String ids)
          Constructor that takes a string-based set of record specs and parses and populates the list with the string.
 
Method Summary
 void addERecId(long id)
          Deprecated. This method may not be supported in future versions of the MDEX Engine API - use addERecSpec(String) instead. Adds a record ID to the list.
 void addERecSpec(String spec)
          Adds a record specification to the list.
 Object get(int index)
          Gets the element at position index.
 long getERecId(int i)
          Deprecated. This method may not be supported in future versions of the MDEX Engine API - use getERecSpec(int) instead. Gets the record ID at position index.
 String getERecSpec(int i)
          Gets the record specification at position index.
 Object remove(int index)
          Removes the element at the specified position in this list.
 int size()
          Returns the number of elements in this list.
 String toString()
          Generates the string-based representation of the this by returning a space delimited sequence of record 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

ERecIdList

public ERecIdList()
Default constructor.


ERecIdList

public ERecIdList(String ids)
Constructor that takes a string-based set of record specs and parses and populates the list with the string. The string is expected to be a space-delimited sequence of unsigned ints.

Parameters:
ids - Space-delimited sequence of record specifications.

ERecIdList

public ERecIdList(long erecId)
Deprecated. This method may not be supported in future versions of the MDEX Engine API - use ERecIdList(String) instead. Constructor that takes a single id and makes a record id list with only one element.

Parameters:
erecId - Single record id member of this list.
Method Detail

addERecSpec

public void addERecSpec(String spec)
Adds a record specification to the list.

Parameters:
spec - Specification to add to the list.

getERecSpec

public String getERecSpec(int i)
Gets the record specification at position index.

Returns:
Record specification at index.

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 - Offset of element.
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 String. 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 elements 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 the list.

toString

public String toString()
Generates the string-based representation of the this by returning a space delimited sequence of record ids.

Overrides:
toString in class AbstractCollection
Returns:
Space delimited sequence of record ids.

addERecId

public void addERecId(long id)
Deprecated. This method may not be supported in future versions of the MDEX Engine API - use addERecSpec(String) instead. Adds a record ID to the list.

Parameters:
id - ID to add to the list.

getERecId

public long getERecId(int i)
               throws NumberFormatException
Deprecated. This method may not be supported in future versions of the MDEX Engine API - use getERecSpec(int) instead. Gets the record ID at position index.

Returns:
Record ID at index.
Throws:
NumberFormatException


© 2003, 2012 Oracle and/or its affiliates. All rights reserved.
Oracle and/or its affiliates Confidential