|
Enterprise Information Portal APIs |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mm.sdk.common.DKQTerm
Query terms are used to represent a predicate logic expression in a query.
A basic query term can be as simple as a text string (as part of a text query) or
a pair of attribute name and value separated by a comparison operator :
==, >, >=, <, <=, <>, BETWEEN, LIKE, IN
.
Query terms can be combined together with logical operators : AND, OR, NOT
.
This class does not support operators: NOTIN, NOTLIKE, NOTBETWEEN
,
however, you can create an equivalent expression using NOT
logical operator.
Constructor Summary | |
DKQTerm()
Default constructor. |
|
DKQTerm(DKQTerm leftTerm,
short logOpCode,
DKQTerm rightTerm)
Creates a term specifying a query condition to be met. |
|
DKQTerm(java.lang.String stringTerm)
Create a query term based on the string input. |
|
DKQTerm(java.lang.String stringTerm,
DKNVPair[] options)
|
|
DKQTerm(java.lang.String attrName,
short cmpOpCode,
java.lang.String attrValue)
Creates a term specifying a query condition to be met. |
|
DKQTerm(java.lang.String attrName,
short cmpOpCode,
java.lang.String[] attrValues)
Creates a term specifying a query condition to be met. |
Method Summary | |
DKQTerm |
and(DKQTerm rhs)
Apply logical AND operator between this term and another given term. |
java.lang.Object |
clone()
|
DKQTerm |
getLeft()
Gets the left hand side part of this term. |
java.lang.String |
getName()
Gets the attribute name in this term. |
short |
getOpCode()
Gets the operator code in this term. |
DKNVPair[] |
getOptions()
Gets options defined in this term. |
DKQTerm |
getRight()
Gets the right hand side part of this term. |
java.lang.String |
getStringTerm()
Gets the string part of this term. |
java.lang.String |
getValue()
Gets the value part of this term. |
java.lang.String[] |
getValues()
Gets the value part of this term; there are more than one values. |
boolean |
hasMultiValues()
Check if this term has multi-values. |
boolean |
isLeaf()
Check if this term is a leaf. |
boolean |
isNotTerm()
Check if this term is negated. |
DKQTerm |
not()
Apply logical NOT operator to this term, that is, negate this term. |
DKQTerm |
or(DKQTerm rhs)
Apply logical OR operator between this term and another given term. |
void |
setLeft(DKQTerm left)
Sets the left hand side part of this term. |
void |
setName(java.lang.String attrName)
Sets the attribute name part of this term. |
void |
setOpCode(short opCode)
Sets the operator code in this term. |
void |
setOptions(DKNVPair[] options)
Sets options for this term. |
void |
setRight(DKQTerm right)
Sets the right hand side part of this term. |
void |
setStringTerm(java.lang.String stringTerm)
Sets the string part of this term. |
void |
setValue(java.lang.String value)
Sets the value part of this term. |
void |
setValues(java.lang.String[] values)
Sets the value part of this term; there are more than one values. |
java.lang.String |
toString()
Re-constructs the string form of this query expression with the correct levels of required parentheses. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DKQTerm()
public DKQTerm(java.lang.String stringTerm)
stringTerm
- a text query string term.public DKQTerm(java.lang.String stringTerm, DKNVPair[] options)
stringTerm
- a text query string term.options
- options applicable to this term, for example in the test string
the options could be CCSID, wildcard char, etc.public DKQTerm(java.lang.String attrName, short cmpOpCode, java.lang.String attrValue)
attrName
- attribute name in this conditional expressioncmpOpCode
- comparison operator code, that is, >, <, ==, etc.attrValue
- attribute valuepublic DKQTerm(java.lang.String attrName, short cmpOpCode, java.lang.String[] attrValues)
attrName
- attribute name in this conditional expressioncmpOpCode
- comparison operator code which takes more than one values.attrValues
- attribute value arraypublic DKQTerm(DKQTerm leftTerm, short logOpCode, DKQTerm rightTerm)
leftTerm
- left termlogOpCode
- logical operator coderightTerm
- right termMethod Detail |
public short getOpCode()
public void setOpCode(short opCode)
opCode
- the operator code for this termpublic DKQTerm getLeft()
public void setLeft(DKQTerm left)
left
- the left term.public DKQTerm getRight()
public void setRight(DKQTerm right)
public DKQTerm and(DKQTerm rhs)
rhs
- the term to be AND-ed at the right hand sidepublic DKQTerm or(DKQTerm rhs)
rhs
- the term to be OR-ed at the right hand sidepublic DKQTerm not()
public boolean isNotTerm()
public boolean isLeaf()
public java.lang.String getStringTerm()
public void setStringTerm(java.lang.String stringTerm)
stringTerm
- the string partpublic java.lang.String getName()
public void setName(java.lang.String attrName)
attrName
- the attribute namepublic java.lang.String getValue()
public void setValue(java.lang.String value)
the
- new value of this termgetValue()
public java.lang.String[] getValues()
public void setValues(java.lang.String[] values)
values
- a string array of values.public boolean hasMultiValues()
public DKNVPair[] getOptions()
public void setOptions(DKNVPair[] options)
options
- an array of DKNVPair object each indicating option name and value.getOptions()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
|
EIP Java APIs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |