|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.bbk.dcs.automed.qproc.iql.Cell
public class Cell
Every node in an ASG is a Cell, so one has to use this class in order to perform any operations on an ASG
Field Summary | |
---|---|
private int |
annotation
|
private java.lang.String |
annotationID
|
static int |
ASG_COLLECTION_SIZE_ITEMS
|
static int |
ASG_COLLECTION_SIZE_ITEMS_TIMES_TUPLE_TYPE
|
private int |
cellLevel
|
private java.lang.Object |
data
|
private java.util.Calendar |
date
|
private double |
floatNumber
|
private static java.lang.String[] |
indents
|
private long |
intNumber
|
private boolean |
join_annotation
|
private Cell |
l
|
private static int |
MAX_INDENT
|
private int |
optimisation_annotation
|
private Cell |
r
|
private int |
tag
|
static int |
TAG_APPLY
|
static int |
TAG_CONSTRUCTOR
|
static int |
TAG_DATETIME
|
static int |
TAG_FLOAT
|
static int |
TAG_FUNCTION
|
static int |
TAG_INTEGER
|
static int |
TAG_LAMBDA
|
static int |
TAG_SCHEME
|
static int |
TAG_SPECIAL
|
static int |
TAG_STRING
|
static int |
TAG_SYSCONSTRUCTOR
|
static int |
TAG_SYSVARIABLE
|
static int |
TAG_VARIABLE
|
Constructor Summary | |
---|---|
private |
Cell()
|
|
Cell(java.util.Calendar d)
|
|
Cell(java.util.Date d)
|
|
Cell(int snum,
java.util.Calendar d)
|
|
Cell(int snum,
double f)
|
|
Cell(int snum,
long i)
|
|
Cell(int snum,
java.lang.Object sdata)
|
|
Cell(int snum,
java.lang.Object lRef,
java.lang.Object rRef)
|
|
Cell(int snum,
java.lang.Object lRef,
java.lang.Object rRef,
java.lang.Object sdata)
|
|
Cell(java.lang.Object lRef,
java.lang.Object rRef)
|
|
Cell(java.lang.String sdata)
|
Method Summary | |
---|---|
void |
annotate(Cell c,
boolean inComp)
|
Cell |
bsingleton()
Returns the root of an ASG representing an empty bag |
static int |
compareNodes(Cell x,
Cell y)
|
Cell |
copyOfGraph()
Returns an exact copy of the ASG |
java.lang.Object |
data()
Returns the Object contained in the Cell |
boolean |
equals(java.lang.Object o)
|
boolean |
equalsButForConstants(java.lang.Object o)
|
boolean |
equalsButForConstantsCell(java.lang.Object o)
|
boolean |
equalsCell(java.lang.Object o)
|
void |
explore()
|
private void |
explore(int indent,
java.io.PrintStream ps)
|
void |
explore(java.io.PrintStream ps)
|
int |
getAnnotation()
|
java.lang.String |
getAnnotationID()
|
int |
getCellLevel()
|
long |
getCollectionSize(Cell c,
int option)
|
java.util.Calendar |
getDateTime()
|
double |
getFloat()
|
long |
getInt()
|
boolean |
getJoinAnnotation()
|
int |
getOptimisationAnnotation()
|
int |
hashCode()
|
boolean |
isApply()
Returns true if tag is apply |
boolean |
isBConsConstructor()
Returns true if tag is "BCons" |
boolean |
isBNilConstructor()
Returns true if tag is "BNil" |
boolean |
isCollectionConstructor()
Returns true if tag is "Cons", "BCons" or "SCons" |
boolean |
isCollectionNilConstructor()
Returns true if tag is "Nil" |
boolean |
isConsConstructor()
|
boolean |
isConstant()
Returns true if tag is constant |
boolean |
isConstructor()
Returns true if tag is constructor |
boolean |
isConstructor(java.lang.String s)
|
boolean |
isConstructorOrSysConstructor()
Returns true if tag is constructor or system constructor |
boolean |
isDateTime()
|
boolean |
isFloat()
|
boolean |
isFunction()
Returns true if tag is function |
boolean |
isInteger()
|
boolean |
isLambda()
Returns true if tag is lambda |
boolean |
isNilConstructor()
Returns true if tag is "Nil" |
boolean |
isNull()
Returns true if the Cell represents a null value |
boolean |
isNum()
Deprecated. use isNumberType() instead |
boolean |
isNumberType()
|
boolean |
isScheme()
Returns true if tag is scheme |
boolean |
isSConsConstructor()
Returns true if tag is "SCons" |
boolean |
isSNilConstructor()
Returns true if tag is "SNil" |
boolean |
isSpecial()
Returns true if tag is special |
boolean |
isSpecial(java.lang.String s)
|
boolean |
isString()
|
boolean |
isSysConstructor()
Returns true if tag is system constructor |
boolean |
isSysConstructor(java.lang.String s)
|
boolean |
isSysVariable()
Returns true if tag is sysvariable |
boolean |
isVariable()
Returns true if tag is variable |
boolean |
isVarOrSysVar()
Returns true if tag is variable or sysvariable |
Cell |
l()
Returns a reference to the left child of the Cell |
void |
mimicThisCell(Cell n)
Copies content of all fields of input Cell to current Cell. |
private void |
printIndent(java.io.PrintStream ps,
int indent)
|
Cell |
r()
Returns a reference to the right child of the Cell |
boolean |
representsBag()
Returns true if the Cell is the root of an ASG representing a bag |
boolean |
representsBagComprehension()
|
boolean |
representsBSingleton()
|
boolean |
representsCollection()
Returns true if the Cell is the root of an ASG representing a collection |
boolean |
representsCollectionSingleton()
|
boolean |
representsComprehension()
|
boolean |
representsConstructor()
|
boolean |
representsConstructor(java.lang.String s)
|
boolean |
representsFunction()
|
boolean |
representsFunction(FunctionTable ft)
|
boolean |
representsFunction(java.lang.String function,
FunctionTable ft)
|
boolean |
representsFunction(java.lang.String function,
int argNum)
|
boolean |
representsGenerator()
Returns true if the Cell is the root of an ASG representing a generator |
boolean |
representsLambdaExpression()
|
boolean |
representsLet()
|
boolean |
representsList()
Returns true if the Cell is the root of an ASG representing a list |
boolean |
representsListComprehension()
|
boolean |
representsLSingleton()
|
boolean |
representsNestedComprehension()
|
boolean |
representsPair()
Returns true if tag is "Tuple2" |
boolean |
representsSet()
Returns true if the Cell is the root of an ASG representing a set |
boolean |
representsSetComprehension()
|
boolean |
representsSpecial()
|
boolean |
representsSpecial(java.lang.String function,
int argNum)
|
boolean |
representsSSingleton()
|
int |
representsTuple()
Returns the arity of the tuple, or -1 if Cell does not represent a tuple |
void |
set_l(Cell n)
Sets the reference to the left child of the Cell to n |
void |
set_r(Cell n)
Sets the reference to the left child of the Cell to n |
void |
setAnnotation(int annotation)
|
void |
setAnnotationID(java.lang.String s)
|
void |
setCellLevel(int cellLevel)
|
void |
setData(java.lang.Object newData)
Sets the Cell's data |
private void |
setDataValue()
Set cell's actual 'value' from tag |
void |
setDateTime(java.util.Calendar c)
|
void |
setFloat(double f)
|
void |
setInt(long i)
|
void |
setJoinAnnotation(boolean value)
|
void |
setOptimisationAnnotation(int optimisation_annotation)
|
void |
setTag(int i)
|
Cell |
singleton()
Returns the root of an ASG representing an empty list |
Cell |
ssingleton()
Returns the root of an ASG representing an empty set |
int |
tag()
Returns the Cell's tag |
java.lang.String |
text()
Returns the string representation of the object contained in the Cell. |
java.lang.String |
text(boolean withOBID)
|
java.lang.String |
textOBID()
Deprecated. use @link{#text(boolean)} instead |
java.lang.String |
toString()
|
Cell |
toStringType()
|
private int |
tupleTest()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TAG_APPLY
public static final int TAG_LAMBDA
public static final int TAG_SCHEME
public static final int TAG_CONSTRUCTOR
public static final int TAG_VARIABLE
public static final int TAG_FUNCTION
public static final int TAG_SPECIAL
public static final int TAG_SYSVARIABLE
public static final int TAG_INTEGER
public static final int TAG_FLOAT
public static final int TAG_STRING
public static final int TAG_DATETIME
public static final int TAG_SYSCONSTRUCTOR
private int tag
private Cell l
private Cell r
private java.lang.Object data
private long intNumber
private double floatNumber
private java.util.Calendar date
private int annotation
private int optimisation_annotation
private boolean join_annotation
private int cellLevel
private java.lang.String annotationID
private static final int MAX_INDENT
private static final java.lang.String[] indents
public static final int ASG_COLLECTION_SIZE_ITEMS
public static final int ASG_COLLECTION_SIZE_ITEMS_TIMES_TUPLE_TYPE
Constructor Detail |
---|
public Cell(int snum, java.lang.Object lRef, java.lang.Object rRef, java.lang.Object sdata)
snum
- designates the type of the Cell. Possible values: apply, lambda, constant, scheme, constructor, variable,
function, special, sysvariablelRef
- reference to the Cell's left childrRef
- reference to the Cell's right childsdata
- value of sdata depends on snum. Possible values: apply:null, lambda:lambda, constant:(integer, String, ...),
scheme:(String), constructor:(String, for example Cons, Tuple2, ...), variable:(String, e.g. x, y, ...),
function:(function name), special:Let, sysvariable:(wrapper object)public Cell(int snum, java.lang.Object lRef, java.lang.Object rRef)
public Cell(int snum, java.lang.Object sdata)
public Cell(int snum, long i)
public Cell(int snum, double f)
public Cell(int snum, java.util.Calendar d)
public Cell(java.util.Calendar d)
public Cell(java.util.Date d)
public Cell(java.lang.Object lRef, java.lang.Object rRef)
public Cell(java.lang.String sdata)
private Cell()
Method Detail |
---|
public java.lang.String text()
withOBID
- when set true, the schemes are annotated with
their OBID. Useful for debugging, but produces a representation
that is not parsable.public java.lang.String text(boolean withOBID)
public java.lang.String textOBID()
public java.lang.Object data()
public void setInt(long i)
public void setFloat(double f)
public void setDateTime(java.util.Calendar c)
public long getInt()
public double getFloat()
public java.util.Calendar getDateTime()
public boolean isNum()
public boolean isNumberType()
public int tag()
public Cell l()
public Cell r()
public void set_l(Cell n)
public void set_r(Cell n)
public void setData(java.lang.Object newData)
public void setTag(int i)
public void mimicThisCell(Cell n)
public Cell copyOfGraph()
public Cell singleton()
public Cell bsingleton()
public Cell ssingleton()
public boolean isApply()
public boolean isConstructor(java.lang.String s)
s
-
public boolean isSysConstructor(java.lang.String s)
s
-
public boolean isLambda()
public boolean isNull()
public boolean isConstant()
public boolean isFloat()
public boolean isInteger()
public boolean isString()
public boolean isDateTime()
public boolean isScheme()
public boolean isConstructor()
public boolean isSysConstructor()
public boolean isConstructorOrSysConstructor()
public boolean isVariable()
public boolean isSpecial()
public boolean isSpecial(java.lang.String s)
public boolean isFunction()
public boolean isSysVariable()
public boolean isVarOrSysVar()
public boolean isCollectionNilConstructor()
public boolean isNilConstructor()
public boolean isBNilConstructor()
public boolean isSNilConstructor()
public boolean isCollectionConstructor()
public boolean isConsConstructor()
public boolean isBConsConstructor()
public boolean isSConsConstructor()
public boolean representsConstructor()
public boolean representsConstructor(java.lang.String s)
public boolean representsComprehension()
public boolean representsSetComprehension()
public boolean representsListComprehension()
public boolean representsBagComprehension()
public boolean representsLet()
public boolean representsLambdaExpression()
public boolean representsGenerator()
private int tupleTest()
public boolean representsPair()
public int representsTuple()
public boolean representsCollection()
public boolean representsList()
public boolean representsBag()
public boolean representsSet()
public boolean representsCollectionSingleton()
public boolean representsLSingleton()
public boolean representsBSingleton()
public boolean representsSSingleton()
public void setAnnotation(int annotation)
annotation
- sets the annotation for this cell
java.lang.Exception
public int getAnnotation()
QProcException
public void setOptimisationAnnotation(int optimisation_annotation) throws QProcException
optimisation_annotation
- sets the optimisation annotation for this cell
java.lang.Exception
QProcException
public int getOptimisationAnnotation()
QProcException
public boolean representsSpecial()
public boolean representsSpecial(java.lang.String function, int argNum)
public boolean representsFunction(java.lang.String function, int argNum)
function
- the textual representation of a function name, such as (++), (--), "member", ect.
public boolean representsFunction(FunctionTable ft)
public boolean representsFunction(java.lang.String function, FunctionTable ft)
public boolean representsFunction()
public boolean representsNestedComprehension()
QProcException
- thrown if the Cell is not actually the root of a comprehensionpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equalsCell(java.lang.Object o)
public boolean equalsButForConstants(java.lang.Object o)
public boolean equalsButForConstantsCell(java.lang.Object o)
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
private void printIndent(java.io.PrintStream ps, int indent)
public void explore()
public void explore(java.io.PrintStream ps)
private void explore(int indent, java.io.PrintStream ps)
public Cell toStringType() throws QProcException
QProcException
public void annotate(Cell c, boolean inComp) throws QProcException
c
- inComp
- true if we are within a comprehension, false otherwise.
QProcException
private void setDataValue() throws ParseException
ParseException
public java.lang.String getAnnotationID()
public void setAnnotationID(java.lang.String s)
public int getCellLevel()
public void setCellLevel(int cellLevel)
public boolean getJoinAnnotation()
public void setJoinAnnotation(boolean value)
public long getCollectionSize(Cell c, int option)
public static int compareNodes(Cell x, Cell y) throws QProcException
x
- y
-
QProcException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |