|
Stefy | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--stefy.avm.VariableX
VariableX class, DD. The VariableX class is used to separate DD functionallity from the class Variable. It provides methods for building AVMs, printing AVMs, etc.
Field Summary | |
static int |
current_tuple_id
Useful information for semantic calculation. |
Variable |
o
|
static boolean |
PrintInternals
If true, printing AVMs includes some internal information. |
static int |
SMODE_ASSERT
Search mode with assert (fails if a path does not exist). |
static int |
SMODE_CREATE
Search mode with creation of path if necessary and if possible. |
static int |
SMODE_N
Search mode that returns a null (or equivalent) if path does not exist or not possible. |
static int |
SMODE_NCREATE
Search mode that will create a path if necessary and if possible. |
static int |
SMODE_OCREATE
Search mode with overriding creation of path and value if necessary. |
Constructor Summary | |
VariableX()
Constructor. |
|
VariableX(AttributeSet a,
TypeHierarchyX tl)
Constructor. |
|
VariableX(java.lang.String s)
Constructor. |
|
VariableX(Variable v)
Constructor. |
|
VariableX(Variable v,
AttributeSet a,
TypeHierarchyX t)
Constructor. |
Method Summary | |
void |
addPair(java.lang.String p,
java.lang.String atom)
|
void |
addPair(java.lang.String p,
Variable v)
|
VariableX |
compile(java.lang.String s)
Compiles string into this variablex and returns this. |
static VariableX |
compileS(java.lang.String s)
Compiles a new variableX and returns it. |
VariableX |
compileVariable(Tokenizer tok,
java.util.HashMap hash)
|
VariableX |
duplicateAndSeparate()
|
static boolean |
equal(java.lang.Object o1,
java.lang.Object o2)
Compares two variables or objects whether they have equal values. |
Variable |
findSet()
Find the set representative (non-static method). |
static Variable |
findSet(Variable o)
Find the set representative (FIND-UNION data structure) (static method). |
protected static java.lang.Object |
get_p(Variable v)
Gets the value of immediate variable reference (can be another variable). |
Variable |
get(java.lang.String p)
Gets a sub-AVM, fails if the path does not exist (fatal error). |
Variable |
get(java.lang.String p,
int smode)
Get value from an AVM using path. |
Variable |
getA(java.lang.String p)
|
static Variable[] |
getAllSubAVMs(Variable v)
Get an array of all sub-AVMs of a given AVM. |
static Variable |
getAS(Variable v,
java.lang.String p)
Static method for getting a sub-AVM. |
Variable |
getF(java.lang.String p)
|
Variable |
getHelper(java.lang.String p,
int f)
|
Variable |
getN(java.lang.String p)
Gets a sub-AVM. |
static Variable |
getNS(Variable v,
java.lang.String p)
|
static Variable |
getOS(Variable v,
java.lang.String p)
Static method for getting a sub-AVM. |
static java.lang.Object |
getS_p(Variable o,
java.lang.String p,
int smode)
Get the actual object in the path. |
static Variable |
getS(Variable o,
java.lang.String p,
int smode)
Get value from an AVM using path (static). |
Type |
getType()
Gets the type of an AVM. |
Type |
getType(java.lang.String p)
Gets the type of the AVM specified by a path. |
java.lang.String |
getTypeName(java.lang.String p)
Get type name from the path. |
static Type |
getTypeS(Variable v1,
java.lang.String p)
Static function to get a type. |
static java.lang.Object |
getValue(Variable o)
Gets the set value. |
static Tokenizer |
init(Tokenizer tok)
Tokenizer initialization. |
static java.lang.String |
insertPrefix(java.lang.String s,
java.lang.String pref,
int mode)
General string-manipulation function for inserting prefixes. |
static boolean |
isAtom(Variable v)
Verify whether this variable contains an atom, a static method. |
static boolean |
isAVMS(Variable v)
Verify whether this variable contains an AVM, a static method. |
static Variable |
newVariable(java.lang.String type)
Creates a new variable that contains an AVM. |
static void |
remove(Variable v,
java.lang.String p)
Removes a value. |
Variable |
set(java.lang.String p,
java.lang.Object o,
int smode)
Sets the value in an AVM. |
static void |
setOS(Variable v,
java.lang.String p,
java.lang.String a)
Set a value to an atom. |
static Variable |
setS(Variable v,
java.lang.String p,
java.lang.Object o,
int smode)
Sets the value in an AVM (static method). |
void |
setType(java.lang.String p,
java.lang.String t)
Sets a type of a basic AVM, use "" to set the root. |
java.lang.String |
toString()
Returns a string representation of the object variable. |
java.lang.String |
toString(CBFilterAVMTupleX filterAVM)
Returns a string representation of the object variable. |
static java.lang.String |
toString(Variable v)
Returns a string representation of the given variable (static version). |
static java.lang.String |
toString(Variable v,
AttributeSet attSet,
TypeHierarchyX tLat,
CBFilterAVMTupleX avmFilter)
Returns a string representation of the given variable (static version). |
static java.lang.String |
toString(Variable v,
CBFilterAVMTupleX filterAVM)
Returns a string representation of the given variable (static version). |
static java.lang.String |
toString2S(Variable v,
java.util.Map ref,
int[][] count,
AttributeSet attSet,
TypeHierarchyX tlat,
CBFilterAVMTupleX filterAVM)
|
java.lang.String |
toStringShort()
A short string representation of a variable. |
static java.lang.String |
toStringShort(Variable o)
A short string representation of a variable (static version). |
java.lang.String |
toStringType()
The name of the root type. |
VariableX |
unify(VariableX other,
int mode)
Unify this variablex destructively with other variablex and return the result. |
static void |
walkAndMarkS(Variable v,
java.util.Map ref,
int[][] count,
Variable[][] vars)
General purpose depth-first walker. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static boolean PrintInternals
public Variable o
public static final int SMODE_ASSERT
public static final int SMODE_CREATE
public static final int SMODE_N
public static final int SMODE_OCREATE
public static final int SMODE_NCREATE
public static int current_tuple_id
Constructor Detail |
public VariableX(Variable v, AttributeSet a, TypeHierarchyX t)
v
- handled variablea
- associated attribute sett
- associated type hierarcypublic VariableX(Variable v)
v
- handled variablepublic VariableX()
public VariableX(AttributeSet a, TypeHierarchyX tl)
a
- the associated attribute settl
- the associated type hierarchy.public VariableX(java.lang.String s)
s
- the source stringMethod Detail |
public VariableX unify(VariableX other, int mode)
other
- the other variablexmode
- unification mode (UNIFY_D, UNIFY_N, or UNIFY_S)public VariableX duplicateAndSeparate()
public void addPair(java.lang.String p, Variable v)
public void addPair(java.lang.String p, java.lang.String atom)
public Type getType()
getTypeS(stefy.avm.Variable, java.lang.String)
protected static java.lang.Object get_p(Variable v)
public Type getType(java.lang.String p)
p
- the pathgetTypeS(stefy.avm.Variable, java.lang.String)
public static Type getTypeS(Variable v1, java.lang.String p)
v1
- the root AVMp
- the pathpublic java.lang.String getTypeName(java.lang.String p)
p
- pathpublic void setType(java.lang.String p, java.lang.String t)
p
- patht
- the type namepublic static boolean isAVMS(Variable v)
v
- a variablepublic static boolean isAtom(Variable v)
v
- a variablepublic static Variable newVariable(java.lang.String type)
type
- the root type of AVMpublic Variable get(java.lang.String p)
p
- pathpublic Variable getF(java.lang.String p)
public Variable getN(java.lang.String p)
p
- pathpublic static Variable getAS(Variable v, java.lang.String p)
v
- variable containing the AVMp
- the pathnull
if path does not exist.SMODE_ASSERT
public Variable getA(java.lang.String p)
public static Variable getOS(Variable v, java.lang.String p)
v
- variable containing the AVMp
- the pathnull
if path does not exist.getS(stefy.avm.Variable, java.lang.String, int)
,
SMODE_OCREATE
public static Variable getNS(Variable v, java.lang.String p)
public Variable getHelper(java.lang.String p, int f)
public Variable set(java.lang.String p, java.lang.Object o, int smode)
setS(stefy.avm.Variable, java.lang.String, java.lang.Object, int)
public static Variable setS(Variable v, java.lang.String p, java.lang.Object o, int smode)
v
- root AVMp
- path to the valueo
- the value
smode:
- public static void setOS(Variable v, java.lang.String p, java.lang.String a)
v
- the variablep
- the patha
- the atompublic static void remove(Variable v, java.lang.String p)
v
- the variablep
- the pathpublic static Variable getS(Variable o, java.lang.String p, int smode)
o
- variable handled by this static methodp
- path
smode:
- public static java.lang.Object getS_p(Variable o, java.lang.String p, int smode)
o
- the handled variablep
- path
smode:
- public Variable get(java.lang.String p, int smode)
getS(stefy.avm.Variable, java.lang.String, int)
public Variable findSet()
findSet(Variable)
public static Variable findSet(Variable o)
o
- a set elementpublic static java.lang.Object getValue(Variable o)
o
- a set elementpublic static boolean equal(java.lang.Object o1, java.lang.Object o2)
public static Tokenizer init(Tokenizer tok)
tok
- the tokenizer.public static VariableX compileS(java.lang.String s)
s
- the source stringpublic VariableX compile(java.lang.String s)
s
- the source stringpublic VariableX compileVariable(Tokenizer tok, java.util.HashMap hash) throws java.io.IOException
public java.lang.String toStringShort()
public java.lang.String toStringType()
public static java.lang.String toStringShort(Variable o)
public java.lang.String toString()
public java.lang.String toString(CBFilterAVMTupleX filterAVM)
filterAVM
- filter to be applied on each AVM tuple before
producing the string; use null for default behaviour.public static java.lang.String toString(Variable v, CBFilterAVMTupleX filterAVM)
v
- the given variablefilterAVM
- filter to be applied on each AVM tuple before
producing the string; use null for default
behaviour.public static java.lang.String toString(Variable v)
v
- the given variablepublic static java.lang.String toString(Variable v, AttributeSet attSet, TypeHierarchyX tLat, CBFilterAVMTupleX avmFilter)
v
- the given variableattSet
- an attribute settLat
- a type HierarchyavmFilter
- a filter for AVM tuples, if we want to change
the behaviour of the function. Use null to get the
default behaviour.public static Variable[] getAllSubAVMs(Variable v)
v
- the variable (root AVM)public static void walkAndMarkS(Variable v, java.util.Map ref, int[][] count, Variable[][] vars)
public static java.lang.String toString2S(Variable v, java.util.Map ref, int[][] count, AttributeSet attSet, TypeHierarchyX tlat, CBFilterAVMTupleX filterAVM)
public static java.lang.String insertPrefix(java.lang.String s, java.lang.String pref, int mode)
s
- the input stringpref
- the prefixmode
- 0 - for inserting prefixes at the beginning of each
line,
1 - for inserting only after the first line
|
Stefy | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |