com.endeca.navigation
Class ERecSortKeyList

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

public class ERecSortKeyList
extends AbstractList
implements List

Collection of record sort keys exposed as a java.util.List.


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ERecSortKeyList()
           
 
Method Summary
 void add(int index, Object element)
          Inserts the specified element at the specified position in this list Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
 Object get(int index)
          Gets sort key at offset index.
 ERecSortKey getKey(int index)
          Gets sort key at offset index.
 ERecSortKey getKey(String name)
          Gets sort key with the name name.
 Object remove(int index)
          Removes the element at the specified position in this list.
 Object set(int index, Object element)
          Replaces the element at the specified position in this list with the specified element
 int size()
          Gets the number of record sort keys.
 
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, 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, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, subList, toArray, toArray
 

Constructor Detail

ERecSortKeyList

public ERecSortKeyList()
Method Detail

getKey

public ERecSortKey getKey(int index)
Gets sort key at offset index. Typed version of the method get(index) from the List interface. Will throw an IndexOutOfBound exception if offset is not legal.

Parameters:
index - Offset into the list.
Returns:
sort key at offset index.
Throws:
IndexOutOfBoundsException - if index is out of range.

get

public Object get(int index)
Gets sort key at offset index. Typed version of the method get(index) from the List interface. Will throw an IndexOutOfBound exception if offset is not legal.

Specified by:
get in interface List
Specified by:
get in class AbstractList
Parameters:
index - Offset into the list.
Returns:
sort key at offset index.
Throws:
IndexOutOfBoundsException - if index is out of range.

set

public Object set(int index,
                  Object element)
Replaces the element at the specified position in this list with the specified element

Specified by:
set in interface List
Overrides:
set in class AbstractList
Parameters:
index - index of element to replace.
element - element to be stored at the specified position.
Returns:
the element previously at the specified position.

add

public void add(int index,
                Object element)
Inserts the specified element at the specified position in this list Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Specified by:
add in interface List
Overrides:
add in class AbstractList
Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted.
Throws:
IllegalArgumentException - if an ERecSortKey with the same name has already been added to the list

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 index of the element to remove.
Returns:
the element previously at the specified position.

size

public int size()
Gets the number of record sort keys.

Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection
Returns:
Number of record sort keys.

getKey

public ERecSortKey getKey(String name)
Gets sort key with the name name.

Returns:
retuns the sort key specified with name. Returns null if key could with specified name could not be found.


2010 Endeca Technologies, Inc.
Endeca Confidential