com.endeca.navigation.analytics
Class LookupList

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

public class LookupList
extends AbstractList
implements List, QueryNode

LookupList instances represent a list of expressions used to uniquely identify a record in a table (foreign or local). These lookup expressions are objects of type Expr.

Lookup expressions provide the ability to refer to values in record sets that have been previously computed. Lookups can only refer to record sets that were grouped and the LookupList must match the GroupBy fields of the lookup record set. A lookup expression maps a record in the current statement's record set to a record in the lookup record set. A LookupList should therefore contain the same number of expressions as the size of the GroupByList of the table it is used to key into.


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
LookupList()
          Constructs an empty LookupList.
 
Method Summary
 void add(int index, Object obj)
          Inserts a lookup expression object at position index.
 Object get(int index)
          Gets the lookup expression at position index.
 Object remove(int index)
          Removes the lookup expression element at the specified position in this list.
 Object set(int index, Object obj)
          Replaces the lookup expression object at position index with the the lookup expression object specified by obj.
 int size()
          Returns the number of lookup expressions in this LookupList.
 String toString()
          Returns the string form of this LookupList.
 String toWire()
          Returns the wire format of this LookupList.
 void validateSyntax()
          Validates the syntax of this LookupList.
 
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
 
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

LookupList

public LookupList()
Constructs an empty LookupList.

Method Detail

get

public Object get(int index)
Gets the lookup expression at position index. The lookup expression must be of type Expr.

Specified by:
get in interface List
Specified by:
get in class AbstractList
Parameters:
index - offset of the desired lookup expression.
Returns:
The lookup expression (Expr object) at position index.
Throws:
IndexOutOfBoundsException - if index is out of range.

size

public int size()
Returns the number of lookup expressions in this LookupList.

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

set

public Object set(int index,
                  Object obj)
Replaces the lookup expression object at position index with the the lookup expression object specified by obj.

Specified by:
set in interface List
Overrides:
set in class AbstractList
Parameters:
index - offset of the Select object to replace.
obj - the Select object to store.
Returns:
The lookup expression object previously at position index.
Throws:
IndexOutOfBoundsException - if index is out of range.

add

public void add(int index,
                Object obj)
Inserts a lookup expression object at position index. 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 - offset at which the lookup expression object is to be inserted.
obj - the lookup expression object to be inserted.
Throws:
IndexOutOfBoundsException - if index is out of range.

remove

public Object remove(int index)
Removes the lookup expression 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. Object returned is of type From.

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.

toString

public String toString()
Returns the string form of this LookupList. These are of the format:
expression1, expression2...
where expression is the string form of a lookup expression.

Specified by:
toString in interface QueryNode
Overrides:
toString in class AbstractCollection
Returns:
A string representation of this LookupList in the specified format.

toWire

public String toWire()
Returns the wire format of this LookupList. This method is not intended for public use because the wire format is subject to change.

Specified by:
toWire in interface QueryNode
Returns:
A wire format representation of this LookupList.

validateSyntax

public void validateSyntax()
                    throws SyntaxException
Validates the syntax of this LookupList. A LookupList is valid if all of its expressions are themselves valid. Note that a LookupList with no elements is syntactically valid.

Specified by:
validateSyntax in interface QueryNode
Throws:
SyntaxException - if the syntax requirements are not satisfied.


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