|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList
com.endeca.navigation.analytics.AnalyticsQuery
public class AnalyticsQuery
An AnalyticsQuery is an ordered list of
Statement objects. The AnalyticsQuery
object is then set in an ENEQuery object
via the ENEQuery.setAnalyticsQuery() method.
When the query is executed on the Endeca MDEX Engine, each
Statement transforms an input set of records into a resulting
stream of aggregated records. Each Statement operates on
the record set produced by some previous Statement, or on the
records in the Navigation State or on all the records in the MDEX Engine.
Note that each Statement in the AnalyticsQuery
must have a unique name.
Users can construct an AnalyticsQuery with either the
programmatic interface or a text-based syntax. The following is a
programmatic example of retrieving the Statement objects
from an AnalyticsQuery:
// Retrieve ENEQuery from the current request
ENEQuery usq = (ENEQuery)request.getAttribute("eneQuery");
// Get the AnalyticsQuery object from the ENEQuery
AnalyticsQuery aq = usq.getAnalyticsQuery();
// Return an iterator with the Statements in this list
Iterator it_aq = aq.iterator();
// Get the Statement objects from the iterator
while(it_aq.hasNext()) {
Statement st = (Statement)it_aq.next();
...
}
Much of the text-based syntax is based on a subset of the SQL language.
Use the parseQuery(String) parser method to create an AnalyticsQuery
from the String representation of the query. For example, if
str is a String that has been initialized to a valid query, then the
statement:
AnalyticsQuery analytics = AnalyticsQuery.parseQuery(str);
creates an AnalyticsQuery when the str query is parsed.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
AnalyticsQuery()
Construct a new, empty AnalyticsQuery. |
|
| Method Summary | |
|---|---|
void |
add(int index,
Object obj)
Inserts a Statement object at position index. |
Object |
get(int index)
Gets the Statement object at position index. |
static AnalyticsQuery |
parseQuery(String query)
Parses a String form of a Statement query and returns an instance of
AnalyticsQuery if the query is well-formed. |
Object |
remove(int index)
Removes the Statement object at the specified position in this AnalyticsQuery. |
Object |
set(int index,
Object obj)
Replaces the Statement object at position index
with the the Statement object specified by obj. |
int |
size()
Returns the number of Statement objects in
this list. |
String |
toString()
Returns the string form of the syntax tree rooted at this AnalyticsQuery. |
String |
toWire()
Returns the wire form of the query. |
void |
validateSyntax()
Validates an AnalyticsQuery. |
| 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 |
|---|
public AnalyticsQuery()
AnalyticsQuery.
| Method Detail |
|---|
public Object get(int index)
Statement object at position index.
get in interface Listget in class AbstractListindex - offset of the Statement object.
Statement object at position index.
IndexOutOfBoundsException - if index is out of range.public int size()
Statement objects in
this list.
size in interface Collectionsize in interface Listsize in class AbstractCollectionStatement objects in this AnalyticsQuery.
public Object set(int index,
Object obj)
Statement object at position index
with the the Statement object specified by obj.
set in interface Listset in class AbstractListindex - offset of the Statement to be replaced.obj - the Statement to be stored.
Statement object previously at position index.
IndexOutOfBoundsException - if index is out of range.
IllegalArgumentException - if obj is not a Statement.
public void add(int index,
Object obj)
Statement object at position index.
Shifts the Statement element currently at that position (if any) and
any subsequent Statement elements to the right (adds one to their indices).
add in interface Listadd in class AbstractListindex - offset at which the Statement is to be inserted.obj - the Statement to be inserted.
IndexOutOfBoundsException - if index is out of range.
IllegalArgumentException - if obj is not a Statement object.public Object remove(int index)
Statement object at the specified position in this AnalyticsQuery.
Shifts any subsequent Statement objects to the left (subtracts one from
their indices). Returns the Statement object that was removed from the list.
remove in interface Listremove in class AbstractListindex - offset of the Statement object to be removed.
Statement object previously at position index.
IndexOutOfBoundsException - if index is out of range.public String toString()
AnalyticsQuery. Semicolons will delimit
multiple Statement objects.
toString in interface QueryNodetoString in class AbstractCollectionpublic String toWire()
toWire in interface QueryNode
public void validateSyntax()
throws SyntaxException
AnalyticsQuery. The AnalyticsQuery
is valid if it contains at least one Statement,
and all its Statement objects are themselves valid.
validateSyntax in interface QueryNodeSyntaxException - if the AnalyticsQuery does not
contain at least one Statement object.
public static AnalyticsQuery parseQuery(String query)
throws SyntaxException
Statement query and returns an instance of
AnalyticsQuery if the query is well-formed.
query - a Statement in a String text-based syntax.
SyntaxException - if the query is malformed or null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||