|
|||||||||
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.ASG
public class ASG
Every IQL query is internally represented as an Abstract Syntax Graph (ASG).
Field Summary | |
---|---|
protected static java.util.logging.Logger |
logger
|
protected Cell |
root
|
Constructor Summary | |
---|---|
protected |
ASG()
|
|
ASG(Cell n)
|
|
ASG(java.io.File f)
|
|
ASG(java.lang.String s)
|
Method Summary | |
---|---|
void |
annotate()
|
ASG |
copyOfASG()
Creates and returns an exact copy of the ASG. |
static ASG |
emptyBag()
Returns the ASG representation of the empty Bag - a BNil constructor. |
static ASG |
emptyCollection(java.lang.String colType)
|
static ASG |
emptyList()
Returns the ASG representation of the empty List - a Nil constructor. |
static ASG |
emptySet()
Returns the ASG representation of the empty Set - an SNil constructor. |
boolean |
equals(java.lang.Object o)
|
void |
explore()
|
void |
explore(java.io.PrintStream ps)
|
void |
finalize()
|
java.lang.String |
formattedString()
Given that the ASG represents a list the string returned has each element separated by carriage returns for more legible output. |
static java.lang.String |
formattedString(ASG g)
Deprecated. Functionality same as toString(). |
static java.lang.String |
formattedString(Cell n)
Deprecated. Functionality same as toString(). |
static java.lang.String |
fromASG(ASG g)
Returns the text IQL of g. |
static java.lang.String |
fromASG(Cell n)
Returns the text IQL of the abstract syntax graph of which n is the root. |
static java.util.ArrayList |
fromASGCollection(ASG g)
If g represents a list/set/bag this returns an ArrayList of its Cells. |
static java.util.ArrayList |
fromASGCollection(Cell n)
If n is the root of an ASG that represents a list, this returns an ArrayList of its Cells. |
static java.util.ArrayList |
fromASGList(ASG g)
If g represents a list this returns an ArrayList of its Cells. |
static java.util.ArrayList |
fromASGList(Cell n)
If n is the root of an ASG that represents a list, this returns an ArrayList of its Cells. |
static java.util.ArrayList |
fromASGTuple(ASG g)
If g represents a tuple this returns an ArrayList of its Cells. |
static java.util.ArrayList |
fromASGTuple(Cell n)
If n is the root of an ASG that represents a tuple, this returns an ArrayList of its Cells. |
long |
getCollectionSize()
Usage intended only for CallToWrapper cache, to help decide between in-memory and on-disk caching |
static java.lang.String |
getColType(Cell c)
|
static long |
getCreated()
|
static long |
getDestroyed()
|
PersistentKey |
getKey()
|
java.util.Map |
getPersistentAttributes()
|
static boolean |
isDAG(ASG g)
|
static boolean |
isDAG(Cell c)
|
static java.util.ArrayList |
listOfSchemes(ASG g,
boolean full)
Returns a list of the schemes used in the ASG as String objects. |
java.util.ArrayList |
listOfSchemes(boolean full)
Returns a list of the schemes used in the ASG as String objects. |
void |
print()
Prints g in System.out |
void |
print(java.io.File f)
Prints g in file f - if f already exists, it is overwritten. |
void |
print(java.io.File f,
boolean append)
Prints g in file f - if append is set to true, then printing occurs at the end of the file, otherwise file is overwritten. |
void |
print(java.io.PrintStream ps)
|
void |
println()
|
void |
println(java.lang.String s)
|
Cell |
root()
Returns the root of the ASG |
static ASG |
toASGCollection(java.util.ArrayList collection,
java.lang.String type)
Generates an ASG list from an ArrayList. |
static ASG |
toASGList(java.util.ArrayList list)
Generates an ASG list from an ArrayList. |
static ASG |
toASGTuple(java.util.ArrayList list)
Generates an ASG tuple from an ArrayList. |
java.lang.String |
toString()
|
java.lang.String |
toStringOBID()
Use only for printing purposes in debug settings: works just like toString() , but schemes has an OBID suffix. |
void |
unify()
|
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.util.logging.Logger logger
protected Cell root
Constructor Detail |
---|
protected ASG()
public ASG(Cell n)
n
- the root cell of a graph. This graph will be copied and packaged as an ASG.public ASG(java.lang.String s) throws ParseException
s
- text IQL query
java.lang.Exception
ParseException
public ASG(java.io.File f) throws java.io.FileNotFoundException
f
- text file containing the text of an IQL query.
java.io.FileNotFoundException
Method Detail |
---|
public static ASG toASGList(java.util.ArrayList list)
public static ASG toASGCollection(java.util.ArrayList collection, java.lang.String type)
public static ASG toASGTuple(java.util.ArrayList list)
public static java.util.ArrayList fromASGCollection(ASG g) throws QProcException
QProcException
public static java.util.ArrayList fromASGCollection(Cell n)
public static java.util.ArrayList fromASGList(ASG g)
public static java.util.ArrayList fromASGList(Cell n)
public static java.util.ArrayList fromASGTuple(ASG g) throws QProcException
QProcException
public static java.util.ArrayList fromASGTuple(Cell n)
QProcException
public java.util.ArrayList listOfSchemes(boolean full)
full
- true if the format :P:S:M:C:<<...>>:T is needed, false if the simple <<...>> format is
neededpublic static java.util.ArrayList listOfSchemes(ASG g, boolean full)
public Cell root()
public static ASG emptyList()
public static ASG emptySet()
public static ASG emptyBag()
public static ASG emptyCollection(java.lang.String colType) throws QProcException
QProcException
public static java.lang.String getColType(Cell c) throws QProcException
QProcException
public ASG copyOfASG()
public void println()
public void println(java.lang.String s)
public void print()
public void print(java.io.PrintStream ps)
public java.lang.String toStringOBID()
toString()
, but schemes has an OBID suffix.
public void print(java.io.File f) throws java.io.IOException
QProcException
java.io.IOException
public void print(java.io.File f, boolean append) throws java.io.IOException
QProcException
java.io.IOException
public static java.lang.String fromASG(ASG g)
public static java.lang.String fromASG(Cell n)
public static java.lang.String formattedString(ASG g)
public static java.lang.String formattedString(Cell n)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String formattedString()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public long getCollectionSize()
public void annotate()
public void unify() throws QProcException
QProcException
public static boolean isDAG(ASG g)
public static boolean isDAG(Cell c)
public void explore()
public void explore(java.io.PrintStream ps)
public void finalize()
finalize
in class java.lang.Object
public PersistentKey getKey()
getKey
in interface PersistentObject
public java.util.Map getPersistentAttributes()
getPersistentAttributes
in interface PersistentObject
public static long getCreated()
public static long getDestroyed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |