|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--one.world.core.Tuple
|
+--one.world.io.Query
Implementation of a query. Queries are used to select specific
tuples when performing input operations. Queries are either empty,
unary, binary, or comparison queries. Empty queries are always
true. Unary queries apply a unary operator on another query. Binary
queries apply a binary operator on two other queries. Finally,
comparison queries compare the field of a tuple to a value. The
field of a tuple is specified as a string, giving the field's
name. The tuple itself can be specified by using the empty
string. Nested fields of nested tuples can be specified by using
the corresponding chain of field names, where the individual field
names are separated by dots ('.').
Whether a comparison query is valid for a given field, depends on the type of the field. For the tuple itself, only queries for its type, subtype, or declared type are valid. For arbitrary objects, only queries for the type, subtype, declared type, equality, or inequality are valid. For numeric types, either in their primitive or in their boxed form, all comparisons besides begins-with, contains, ends-with are valid. Finally, for strings and binary data, all comparisons are valid.
| Field Summary | |
static int |
BINARY_AND
The and binary operator. |
static int |
BINARY_OR
The or binary operator. |
static int |
COMPARE_BEGINS_WITH
The begins with comparison operator. |
static int |
COMPARE_CONTAINS
The contains comparison operator. |
static int |
COMPARE_ENDS_WITH
The ends with comparison operator. |
static int |
COMPARE_EQUAL
The equal comparison operator. |
static int |
COMPARE_GREATER
The greater than comparison operator. |
static int |
COMPARE_GREATER_EQUAL
The greater equal comparison operator. |
static int |
COMPARE_HAS_DECLARED_TYPE
The has declared type comparison operation. |
static int |
COMPARE_HAS_FIELD
The has field comparison operator. |
static int |
COMPARE_HAS_SUBTYPE
The has subtype comparison operator. |
static int |
COMPARE_HAS_TYPE
The has type comparison operator. |
static int |
COMPARE_LESS
The less than comparison operator. |
static int |
COMPARE_LESS_EQUAL
The less equal comparison operator. |
static int |
COMPARE_NOT_EQUAL
The not equal comparison operator. |
String |
field
The field specifier for comparison queries. |
int |
op
The operator for unary, binary, and comparison queries. |
Query |
query1
The first query for unary and binary queries. |
Query |
query2
The second query for binary queries. |
int |
type
The type of this query. |
static int |
TYPE_BINARY
The binary type. |
static int |
TYPE_COMPARE
The comparison type. |
static int |
TYPE_EMPTY
The empty type. |
static int |
TYPE_UNARY
The unary type. |
static int |
UNARY_NOT
The not unary operator. |
Object |
value
The value for comparison queries. |
| Fields inherited from class one.world.core.Tuple |
CLOSURE, id, ID, META_DATA, metaData, SOURCE |
| Constructor Summary | |
Query()
Create a new empty query. |
|
Query(int op,
Query query1)
Create a new unary query. |
|
Query(Query query1,
int op,
Query query2)
Create a new binary query. |
|
Query(String field,
int op,
Object value)
Create a new comparison query. |
|
| Method Summary | |
void |
validate()
Validate this query. |
| Methods inherited from class one.world.core.Tuple |
clone, containsNonSymbolicHandler, equals, fields, get, getMetaData, getType, hasField, hashCode, hasMetaData, remove, set, setMetaData, toString, wrap |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int TYPE_EMPTY
public static final int TYPE_UNARY
public static final int TYPE_BINARY
public static final int TYPE_COMPARE
public static final int UNARY_NOT
public static final int BINARY_AND
public static final int BINARY_OR
public static final int COMPARE_EQUAL
public static final int COMPARE_NOT_EQUAL
public static final int COMPARE_GREATER
public static final int COMPARE_GREATER_EQUAL
public static final int COMPARE_LESS
public static final int COMPARE_LESS_EQUAL
public static final int COMPARE_BEGINS_WITH
public static final int COMPARE_CONTAINS
public static final int COMPARE_ENDS_WITH
public static final int COMPARE_HAS_TYPE
public static final int COMPARE_HAS_SUBTYPE
public static final int COMPARE_HAS_DECLARED_TYPE
java.lang.Object.public static final int COMPARE_HAS_FIELD
null.public int type
public int op
public Query query1
public Query query2
public String field
public Object value
| Constructor Detail |
public Query()
public Query(int op,
Query query1)
op - The unary operator.query1 - The query to operate on.
public Query(Query query1,
int op,
Query query2)
query1 - The first query to operate on.op - The binary operator.query2 - The second query to operate on.
public Query(String field,
int op,
Object value)
field - The field for the comparison.op - The comparison operator.value - The value for the comparison.| Method Detail |
public void validate()
throws TupleException
validate in class Tupleone.world.core.TupleTupleException - Signals that the tuple is either malformed
(i.e., does not conform to the tuple
specification) or invalid (i.e., does not
conform to the semantic constraints of its
type).MalformedTupleException,
InvalidTupleException,
Type.validate(Class)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||