public abstract class CompositePredicate extends AbstractPredicate
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList |
m_clauses |
Constructor and Description |
---|
CompositePredicate()
Create a new, empty CompositePredicate.
|
CompositePredicate(Predicate p1,
Predicate p2)
Create a new CompositePredicate.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Predicate p)
Add a new clause.
|
protected void |
addChildListeners()
Add child listeners to catch and propagate sub-expression updates.
|
void |
clear()
Remove all clauses.
|
Predicate |
get(int idx)
Get the sub-predicate at the given index.
|
Predicate |
getSubPredicate(Predicate p)
Get a predicate instance just like this one but without
the given predicate as a clause.
|
boolean |
remove(Predicate p)
Remove a new clause.
|
protected void |
removeChildListeners()
Remove child listeners for sub-expression updates.
|
void |
set(Predicate p)
Set the given predicate to be the only clause of thie composite.
|
void |
set(Predicate[] p)
Set the given predicates to be the clauses of thie composite.
|
int |
size()
Get the number of sub-predicate clauses.
|
protected java.lang.String |
toString(java.lang.String op)
Return a String representation of this predicate.
|
void |
visit(ExpressionVisitor v)
Passes the visitor through this expression and any sub expressions
|
get, getType
addExpressionListener, expressionChanged, fireExpressionChange, getBoolean, getDouble, getFloat, getInt, getLong, hasListeners, removeExpressionListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addExpressionListener, getBoolean, getDouble, getFloat, getInt, getLong, removeExpressionListener
public CompositePredicate()
public void add(Predicate p)
p
- the Predicate clause to addpublic boolean remove(Predicate p)
p
- the Predicate clause to removepublic void clear()
public int size()
public Predicate get(int idx)
idx
- the index to lookuppublic void set(Predicate p)
p
- the new sole sub-predicate clausepublic void set(Predicate[] p)
p
- the new sub-predicate clausespublic Predicate getSubPredicate(Predicate p)
p
- the predicate clause to ignorepublic void visit(ExpressionVisitor v)
Expression
visit
in interface Expression
visit
in class AbstractExpression
v
- the ExpressionVisitorExpression.visit(prefuse.data.expression.ExpressionVisitor)
protected void addChildListeners()
AbstractExpression
addChildListeners
in class AbstractExpression
AbstractExpression.addChildListeners()
protected void removeChildListeners()
AbstractExpression
removeChildListeners
in class AbstractExpression
AbstractExpression.removeChildListeners()
protected java.lang.String toString(java.lang.String op)
op
- a String describing the operation this Predicate performsCopyright ? 2013 Regents of the University of California