com.endeca.navigation.analytics
Class SelectList

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

public class SelectList
extends AbstractList
implements List, QueryNode

A SelectList is a list of Select expressions.


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

SelectList

public SelectList()
Constructs a new, empy SelectList.

Method Detail

get

public Object get(int index)
Gets the Select object at position index.

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

size

public int size()
Returns the number of Select expressions in this SelectList.

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

set

public Object set(int index,
                  Object obj)
Replaces the Select object at position index with the the Select 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 Select object previously at position index.
Throws:
IndexOutOfBoundsException - if index is out of range.
IllegalArgumentException - if obj is not a Select.

add

public void add(int index,
                Object obj)
Inserts a Select object at position index. Shifts the Select element currently at that position (if any) and any subsequent Select 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 Select is to be inserted.
obj - the Select to be inserted.
Throws:
IndexOutOfBoundsException - if index is out of range.
IllegalArgumentException - if obj is not a Select.

remove

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

Specified by:
remove in interface List
Overrides:
remove in class AbstractList
Parameters:
index - offset of the Select to be removed.
Returns:
Select element previously at position index.
Throws:
IndexOutOfBoundsException - if index is out of range.

toString

public String toString()
Returns the string form of this SelectList. These are of the format:
SELECT expression1 AS derived-prop-name1, expression2 AS derived-prop-name2...
where expression is the string form of an Expr expression and derived-prop-name is the name of the derived property that will be produced.

For example:

SELECT COUNT(TransId) AS NumTrans
is returned if the derived property name is "NumTrans" and the expression uses the COUNT function to compute the number of transactions by the "TransId" field.

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

toWire

public String toWire()
Returns the wire format of this SelectList. 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 SelectList.

validateSyntax

public void validateSyntax()
                    throws SyntaxException
Validates the syntax of this SelectList. A SelectList is valid if it is non-empty and all its Select elements are themselves valid.

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


2010 Endeca Technologies, Inc.
Endeca Confidential