|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.search.rewriter.DeclarableVariable
public class DeclarableVariable
A class encapsulating details about a variable which is to be declared in a suitable SimpleQuery during a query rewrite. This will be done by SimpleQueryCreator. Records the variable along with the conditions which use it, and a boolean indicating whether or not this variable has been declared yet in a new SimpleQuery.
Constructor Summary | |
---|---|
DeclarableVariable(java.lang.String name,
java.util.List types)
Initialise the object with a variable name and types. |
|
DeclarableVariable(java.lang.String name,
java.util.List types,
boolean exists,
boolean forall)
Initialise the object with a variable name and types, and whether it's declared exists or forall. |
Method Summary | |
---|---|
void |
addCondition(MinimalCondition mc)
Adds a MinimalCondition to the list of conditions which use this variable. |
java.util.List |
getBareConditions()
Returns the condition nodes involving this variable. |
int |
getCardinality()
Returns the number of conditions involving this variable. |
java.util.List |
getConditions()
Returns the conditions involving this variable. |
java.util.List |
getConditionsOfCardinality(int n)
Returns all the MinimalCondition objects which are of the given cardinality (those which involve n variables). |
java.lang.String |
getName()
Returns the name of the variable. |
java.util.List |
getTypes()
Returns a list of the possible types of the variable. |
boolean |
isExists()
return true if the variable was declared as 'exists' |
boolean |
isForall()
return true if the variable was declared as 'forall' |
boolean |
isLone()
Returns true if all the conditions containing this variable contain only this variable (are of cardinality 1). |
void |
setExists(boolean val)
set the variable to be an 'exists' var |
void |
setForall(boolean val)
set the variable to be an 'forall' var |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DeclarableVariable(java.lang.String name, java.util.List types)
public DeclarableVariable(java.lang.String name, java.util.List types, boolean exists, boolean forall)
Method Detail |
---|
public void addCondition(MinimalCondition mc)
public int getCardinality()
public java.util.List getConditions()
public java.util.List getBareConditions()
public java.util.List getTypes()
public java.lang.String getName()
public java.util.List getConditionsOfCardinality(int n)
public boolean isLone()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isExists()
public boolean isForall()
public void setExists(boolean val)
public void setForall(boolean val)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |