|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectagg.attribute.impl.AttrObject
agg.attribute.impl.ManagedObject
agg.attribute.impl.ContextCore
public class ContextCore
Contains declarations and values of context variables; Note that this class does NOT implement the AttrContext interface; The actual implementation for it is the wrapper class ContextView, which allows to restrict access to a context while sharing actual state (variables, conditions, mappings). An example are the different access rights of the left and the right rule side in graph transformation.
ContextView
,
Serialized FormField Summary | |
---|---|
protected CondTuple |
conditions
Conditions of this context. |
protected java.util.Vector<TupleMapping> |
delayedMappingRemovals
Container with deferred mapping removals. |
protected boolean |
isFrozen
Flag; when set, mapping removals are deferred. |
protected java.util.Hashtable<ValueTuple,java.util.Vector<TupleMapping>> |
mappings
Table of mappings. |
protected int |
mapStyle
Kind of mapping in this context, PLAIN_MAP or MATCH_MAP. |
protected ContextCore |
parent
Parent context of this context, chain of inheritance. |
protected VarTuple |
variables
Variables and parameters of this context. |
Fields inherited from class agg.attribute.impl.ManagedObject |
---|
manager |
Fields inherited from class agg.attribute.impl.AttrObject |
---|
classHandlerExpr, classObject, classString, initialized |
Constructor Summary | |
---|---|
ContextCore(AttrTupleManager manager,
int mapStyle)
Creating a new root context. |
|
ContextCore(AttrTupleManager manager,
int mapStyle,
ContextCore parent)
Creating a new child context. |
Method Summary | |
---|---|
boolean |
addDecl(AttrHandler handler,
java.lang.String type,
java.lang.String name)
Adding a new declaration; "name" is a key and must not have been previously used for a declaration in this context or any of its parents. |
void |
addMapping(TupleMapping mapping)
Adding a new mapping to this context. |
boolean |
canSetValue(java.lang.String name,
ValueMember value)
Checking if a variable can be set to a given value without violating the application conditions. |
void |
clearErrorMsg()
|
void |
defreeze()
Perform mapping removals which were delayed during the freeze mode. |
void |
dispose()
Prepare myself for garbage collection. |
protected void |
finalize()
|
void |
freeze()
Switching on of the freeze mode; mapping removals are deferred until 'defreeze()' is called. |
int |
getAllowedMapping()
Getting the mapping style (match or plain). |
CondTuple |
getConditions()
|
DeclMember |
getDecl(java.lang.String name)
Getting the declaration (type) of a variable; |
java.lang.String |
getErrorMsg()
|
protected java.util.Hashtable<ValueTuple,java.util.Vector<TupleMapping>> |
getMapping()
returns all mappings |
java.util.Vector<TupleMapping> |
getMappingsToTarget(ValueTuple target)
Returns Vector of mappings (TupleMapping) to a target object. |
ValueMember |
getValue(java.lang.String name)
Getting the value of a variable. |
VarTuple |
getVariables()
|
boolean |
isDeclared(java.lang.String name)
Tests if a variable has already been declared in this context or in any of its parents; |
boolean |
isFrozen()
Checking if this context is "frozen". |
boolean |
isVariableContext()
|
void |
makeCopyOf(ContextCore context)
|
void |
removeAllMappings()
|
void |
removeDecl(java.lang.String name)
Removing a declaration from this context; Parent contextes are NOT considered; Does nothing if the variable "name" is not declared; |
boolean |
removeMapping(TupleMapping mapping)
Removing a mapping. |
void |
removeValue(java.lang.String name)
Removing a variable |
void |
setValue(java.lang.String name,
ValueMember value)
Setting a variable value. |
void |
setVariableContext(boolean b)
A variable context mins that mainly variables will be used as values of the graph objects of a graph, so if a rule / match attribute context has an attribute condition, it cannot be evaluated and will get TRUE as result. |
Methods inherited from class agg.attribute.impl.ManagedObject |
---|
getAttrManager, getManager |
Methods inherited from class agg.attribute.impl.AttrObject |
---|
defaultToString, err, err, getInstRepr, log, log, log, logEnteredMethod, logPrintln, logPrintln, stdoutPrintOnEnter, stdoutPrintOnExit, toString, update, warn, warn, warn, warn |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int mapStyle
protected ContextCore parent
protected java.util.Hashtable<ValueTuple,java.util.Vector<TupleMapping>> mappings
protected CondTuple conditions
protected VarTuple variables
protected transient boolean isFrozen
protected transient java.util.Vector<TupleMapping> delayedMappingRemovals
Constructor Detail |
---|
public ContextCore(AttrTupleManager manager, int mapStyle)
mapStyle
- The kind of mapping that is done within this context; it is
one of:
public ContextCore(AttrTupleManager manager, int mapStyle, ContextCore parent)
mapStyle
- The kind of mapping that is allowed within this context; it is
one of:
parent
- The parent of the new contextMethod Detail |
---|
public void makeCopyOf(ContextCore context)
public void dispose()
Disposable
dispose
in interface Disposable
protected final void finalize()
finalize
in class java.lang.Object
public java.lang.String getErrorMsg()
public void clearErrorMsg()
public CondTuple getConditions()
public VarTuple getVariables()
public boolean isFrozen()
public void freeze()
public void defreeze()
public void setVariableContext(boolean b)
public boolean isVariableContext()
agg.attribute.impl
public int getAllowedMapping()
public void addMapping(TupleMapping mapping)
protected java.util.Hashtable<ValueTuple,java.util.Vector<TupleMapping>> getMapping()
public java.util.Vector<TupleMapping> getMappingsToTarget(ValueTuple target)
public boolean removeMapping(TupleMapping mapping)
public void removeAllMappings()
public boolean isDeclared(java.lang.String name)
name
- The name of the variable
public boolean addDecl(AttrHandler handler, java.lang.String type, java.lang.String name)
name
- The name of the variable to declaretype
- The type of the variable
public void removeDecl(java.lang.String name)
name
- The name of the variable to removepublic DeclMember getDecl(java.lang.String name) throws NoSuchVariableException
name
- The name of the variable
NoSuchVariableException
- If no variable 'name' is declaredpublic boolean canSetValue(java.lang.String name, ValueMember value)
public void setValue(java.lang.String name, ValueMember value) throws NoSuchVariableException
name
- Name of the variable to assign tovalue
- Value to assign
NoSuchVariableException
- If the name is not declared in this context.public void removeValue(java.lang.String name) throws NoSuchVariableException
name
- Name of the variable to remove
NoSuchVariableException
- If the name is not declared in this context.public ValueMember getValue(java.lang.String name)
name
- Name of the variable to get the value from
NoSuchVariableException
- If the name is not declared in this context.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |