public class CompoundCriteria extends LogicalCriteria
LanguageObject.Util
Modifier and Type | Field and Description |
---|---|
static int |
AND
Constant indicating the logical "and" of two or more criteria.
|
static int |
OR
Constant indicating the logical "or" of two or more criteria.
|
Constructor and Description |
---|
CompoundCriteria()
Constructs a default instance of this class.
|
CompoundCriteria(int operator,
Criteria left,
Criteria right)
Constructs an instance of this class given a binary logical expression.
|
CompoundCriteria(int operator,
List criteria)
Constructs an instance of this class given a general logical expression.
|
CompoundCriteria(List<? extends Criteria> criteria)
Constructs an instance of this class given the criteria.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.
|
void |
addCriteria(Criteria criteria)
Add another criteria to the clause.
|
Object |
clone()
Deep clone.
|
boolean |
equals(Object obj)
Override equals() method.
|
List<Criteria> |
getCriteria()
Returns the list of criteria.
|
Criteria |
getCriteria(int index)
Returns the criteria at the specified index.
|
int |
getCriteriaCount()
Returns the number of criteria in this clause.
|
int |
getOperator()
Returns the operator used in the logical expression.
|
int |
hashCode()
Get hash code.
|
protected void |
reset()
Reset criteria so there are no more.
|
void |
set(int operator,
Criteria criteria)
Sets a "standard" unary criteria.
|
void |
set(int operator,
Criteria left,
Criteria right)
Sets a "standard" operand-operator-operand criteria.
|
void |
set(int operator,
List criteria)
Sets the operator and an arbitrary set of criteria.
|
void |
setCriteria(List<Criteria> criteria)
Sets the criteria.
|
void |
setOperator(int operator)
Sets the operator used in the logical expression.
|
applyDemorgan, combineCriteria, combineCriteria, combineCriteria, getType, separateCriteriaByAnd, toString
public static final int OR
public static final int AND
public CompoundCriteria()
public CompoundCriteria(List<? extends Criteria> criteria)
criteria
- List of Criteria
being addedpublic CompoundCriteria(int operator, Criteria left, Criteria right)
left
- The criteria left of the operatorright
- The criteria right of the operatoroperator
- The logical operatorset(int,Criteria,Criteria)
public CompoundCriteria(int operator, List criteria)
operator
- The logical operatorcriteria
- The list of Criteria
public int getOperator()
public void setOperator(int operator)
operator
- The operatorIllegalArgumentException
- If operator is invalidpublic List<Criteria> getCriteria()
Criteria
public void setCriteria(List<Criteria> criteria)
criteria
- The list of Criteria
public int getCriteriaCount()
public Criteria getCriteria(int index)
IllegalArgumentException
- if no criteria have been specifiedpublic void addCriteria(Criteria criteria)
criteria
- The criteriaprotected void reset()
getCriteriaCount
will return 0.public void set(int operator, Criteria left, Criteria right)
operator
- The logical operatorleft
- The first criteriaright
- The second criteriaset(int,List)
public void set(int operator, Criteria criteria)
operator
- The unary logical operatorcriteria
- The criteriaset(int,List)
public void set(int operator, List criteria)
operator
- The logical operatorcriteria
- The set of criteriaset(int,Criteria,Criteria)
public void acceptVisitor(LanguageVisitor visitor)
LanguageObject
visitor
- Visitor being usedpublic int hashCode()
public boolean equals(Object obj)
public Object clone()
clone
in interface LanguageObject
clone
in class Criteria
Copyright © 2019. All rights reserved.