|
|||||||||
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.ContextView
public class ContextView
This is a view onto an underlying ContextCore class object; By this delegation, views with different access rights can share the same context; At this stage, just two access modes are implemented: "LeftRuleSide" and "RightRuleSide"; "RightRuleSide" access does not allow adding or removing of variable declarations;
ContextCore
,
Serialized FormField Summary | |
---|---|
protected boolean |
canDeclareVar
Describes the access mode. |
protected boolean |
canHaveEmptyValues
Describes the access mode. |
protected boolean |
canUseComplexExpr
Describes the access mode. |
protected boolean |
canUseInitialExpr
Describes the access mode. |
protected ContextCore |
core
Handle to the actual context core. |
Fields inherited from class agg.attribute.impl.ManagedObject |
---|
manager |
Fields inherited from class agg.attribute.impl.AttrObject |
---|
classHandlerExpr, classObject, classString, initialized |
Constructor Summary | |
---|---|
ContextView(AttrTupleManager manager,
AttrContext source,
boolean leftRuleSide)
Returns a new view which shares another view's context and has the specified access mode; |
|
ContextView(AttrTupleManager manager,
ContextCore source)
Returns a new view for the specified context. |
|
ContextView(AttrTupleManager manager,
int mapStyle)
Creates a new root context and returns a full access view for it; |
|
ContextView(AttrTupleManager manager,
int mapStyle,
AttrContext parent)
Creates a new child context and returns a full access view for it; |
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 before; |
void |
addMapping(TupleMapping mapping)
Adding another Mapped pair to the actual 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 |
copyAttrContext(AttrContext context)
|
void |
defreeze()
Perform mapping removals which were delayed during the freeze mode. |
void |
dispose()
Prepare myself for garbage collection. |
boolean |
doesAllowComplexExpressions()
Query if we're on the right rule side. |
boolean |
doesAllowEmptyValues()
Query if we're on the left rule side. |
boolean |
doesAllowInitialExpressions()
Query if we're on the left or right rule side. |
boolean |
doesAllowNewVariables()
Query if we're on the left rule side. |
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). |
AttrConditionTuple |
getConditions()
|
java.lang.String |
getErrorMsg()
|
HandlerExpr |
getExpr(java.lang.String name)
Implementing the SymbolTable interface for value retrieval. |
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. |
int |
getMapStyle()
|
HandlerType |
getType(java.lang.String name)
Implementing the SymbolTable interface for type retrieval. |
AttrVariableTuple |
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 |
isVariableContext()
|
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 Mapped pair from the actual context. |
void |
removeValue(java.lang.String name)
Removing the value of the specified variable name from this context; |
void |
setAllowComplexExpr(boolean isAllowed)
|
void |
setAllowEmptyValues(boolean isAllowed)
|
void |
setAllowInitialExpr(boolean isAllowed)
|
void |
setAllowVarDeclarations(boolean isAllowed)
|
void |
setAttrContext(AttrContext source)
Maybe a distributed graph wants to set an attribute context |
void |
setValue(java.lang.String name,
ValueMember value)
Appending a value to a variable; This will be the current value until a new value will be appended or this one removed |
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 ContextCore core
protected boolean canDeclareVar
protected boolean canUseComplexExpr
protected boolean canHaveEmptyValues
protected boolean canUseInitialExpr
Constructor Detail |
---|
public ContextView(AttrTupleManager manager, int mapStyle)
manager
- The calling Attribute ManagermapStyle
- The kind of mapping that is allowed within this context; it is
one of:
public ContextView(AttrTupleManager manager, int mapStyle, AttrContext parent)
manager
- The calling Attribute ManagermapStyle
- The kind of mapping that is allowed within this context; it is
one of:
parent
- The view whose context is to be the parent for this view's
contextpublic ContextView(AttrTupleManager manager, AttrContext source, boolean leftRuleSide)
manager
- The calling Attribute Managersource
- The view to share the context withleftRuleSide
- Convenience parameter, sets access control appropriately.public ContextView(AttrTupleManager manager, ContextCore source)
manager
- The calling Attribute Managersource
- The context to view at.Method Detail |
---|
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 void setVariableContext(boolean b)
public boolean isVariableContext()
agg.attribute.impl
public AttrConditionTuple getConditions()
getConditions
in interface AttrContext
public AttrVariableTuple getVariables()
getVariables
in interface AttrContext
public java.util.Vector<TupleMapping> getMappingsToTarget(ValueTuple target)
public boolean doesAllowComplexExpressions()
doesAllowComplexExpressions
in interface AttrContext
public boolean doesAllowInitialExpressions()
public boolean doesAllowNewVariables()
doesAllowNewVariables
in interface AttrContext
public boolean doesAllowEmptyValues()
doesAllowEmptyValues
in interface AttrContext
public void setAllowVarDeclarations(boolean isAllowed)
setAllowVarDeclarations
in interface AttrContext
public void setAllowComplexExpr(boolean isAllowed)
setAllowComplexExpr
in interface AttrContext
public void setAllowInitialExpr(boolean isAllowed)
public void setAllowEmptyValues(boolean isAllowed)
setAllowEmptyValues
in interface AttrContext
public void setAttrContext(AttrContext source)
setAttrContext
in interface AttrContext
source
- the object to take the information frompublic void copyAttrContext(AttrContext context)
public void freeze()
freeze
in interface AttrContext
public void defreeze()
defreeze
in interface AttrContext
public HandlerType getType(java.lang.String name)
getType
in interface AttrContext
getType
in interface SymbolTable
name
- Identifier's name
SymbolTable
public HandlerExpr getExpr(java.lang.String name)
getExpr
in interface AttrContext
getExpr
in interface SymbolTable
name
- Identifier's name
SymbolTable
public int getAllowedMapping()
public void addMapping(TupleMapping mapping)
public java.util.Hashtable<ValueTuple,java.util.Vector<TupleMapping>> getMapping()
public boolean removeMapping(TupleMapping mapping)
public void removeAllMappings()
removeAllMappings
in interface AttrContext
public int getMapStyle()
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) throws ContextRestrictedException
name
- The name of the variable to declaretype
- The type of the variable
ContextRestrictedException
- If this view is restrictedpublic void removeDecl(java.lang.String name) throws ContextRestrictedException
name
- The name of the variable to remove
ContextRestrictedException
- If this view is restrictedpublic boolean canSetValue(java.lang.String name, ValueMember value)
public void setValue(java.lang.String name, ValueMember value) throws NoSuchVariableException
name
- The name of the variablevalue
- The value to append to the variable
NoSuchVariableException
- If no variable 'name' is declaredpublic void removeValue(java.lang.String name) throws NoSuchVariableException
name
- The name of the variable
NoSuchVariableException
- If no variable 'name' is declared
WrongContextException
- If the value was not assigned in this context
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |