agg.attribute.impl
Class VarMember

java.lang.Object
  extended by agg.attribute.impl.AttrObject
      extended by agg.attribute.impl.Member
          extended by agg.attribute.impl.ValueMember
              extended by agg.attribute.impl.VarMember
All Implemented Interfaces:
AttrInstanceMember, AttrMember, AttrVariableMember, AttrMsgCode, XMLObject, java.io.Serializable, java.util.Observer

public class VarMember
extends ValueMember
implements AttrVariableMember

Class for members of attribute instance tuples that are used as variables in a context. This is an extension of ValueMember; it adds reference counting.

See Also:
Serialized Form

Field Summary
protected  boolean isIn
           
protected  boolean isOut
           
static int LHS
          Marking left hand side (LHS) of a rule
static int NAC
          Marking NAC of a rule
static int PAC
           
protected  int refCnt
           
static int RHS
          Marking right hand side (RHS) of a rule
static long serialVersionUID
           
 
Fields inherited from class agg.attribute.impl.ValueMember
currentException, decl, EMPTY_VALUE_SYMBOL, errorMsg, expression, expressionObject, expressionText, isTransient, tuple
 
Fields inherited from class agg.attribute.impl.AttrObject
classHandlerExpr, classObject, classString, initialized
 
Fields inherited from interface agg.attribute.impl.AttrMsgCode
ATTR_DONT_MATCH, BAD_EXPR_TYPE, EXPR_EVAL_ERR, EXPR_MUST_BE_CONST, EXPR_MUST_BE_CONST_OR_VAR, EXPR_PARSE_ERR, EXPR_REQUIRED, MATCH_TARGETS_DIFFER, NAME_DUPLICATION, NO_SUCH_NAME, NO_SUCH_TYPE, OK, RULE_SOURCES_DIFFER, VAR_NOT_DECLARED
 
Constructor Summary
VarMember(VarTuple tuple, DeclMember decl)
          Creating a new instance with the specified type.
 
Method Summary
 void copy(ValueMember fromInstance)
          copy the contents of a single entry instance into another.
protected  void decrementCount()
           
 void delete()
          Removes this member from its tuple.
 java.lang.String getErrorMsg()
           
protected  HandlerExpr getEvaluationResult()
           
 HandlerExpr getExpr()
          Retrieving the expression (value) contained in this member.
 int getMark()
           
 int getReferenceCount()
           
protected  void incrementCount()
           
 boolean isDefinite()
          Test, if the expression evaluates to a constant.
 boolean isEnabled()
           
 boolean isInputParameter()
          Tests if this variable is an IN-parameter.
 boolean isOutputParameter()
          Tests if this variable is an OUT-parameter.
 boolean isUnifiableWith(HandlerExpr srcExpr)
           
 void setEnabled(boolean b)
           
 void setExprAsEvaluatedText(java.lang.String exprText)
          Setting the value.
 void setExprAsObject(java.lang.Object value)
          Setting the value.
 void setExprAsText(java.lang.String exprText)
          Setting the value.
 void setInputParameter(boolean in)
          Sets, if the variable is to be an IN-parameter.
 void setMark(int m)
          The mark m defines a graph context of this variable .
 void setOutputParameter(boolean out)
          Sets, if the variable is to be an OUT-parameter.
protected  void startCount()
           
 java.lang.String toString()
           
 void undoUnification()
           
 boolean unifyWith(HandlerExpr srcExpr)
           
 void update(java.util.Observable o, java.lang.Object arg)
          Implementation of the only Observer interface method.
 
Methods inherited from class agg.attribute.impl.ValueMember
apply, apply, apply, apply, canMatchTo, checkInContext, checkValidity, checkValidity, compareTo, equals, getAllVariableNamesOfExpression, getAttrHandlerExceptionMsg, getChildrenOfExpression, getContext, getDecl, getDeclaration, getExprAsObject, getExprAsText, getHandler, getHoldingTuple, getName, getTuple, getType, getValidityReport, isEmpty, isSet, isTransient, isValid, matchTo, rawGetExpr, rawSetExpr, rawSetExprAsObject, rawSetExprAsText, setCheckedExpr, setExpr, setTransient, typeChanged, XreadObject, XwriteObject
 
Methods inherited from class agg.attribute.impl.Member
fireChanged, getIndexInTuple
 
Methods inherited from class agg.attribute.impl.AttrObject
defaultToString, err, err, getInstRepr, log, log, log, logEnteredMethod, logPrintln, logPrintln, stdoutPrintOnEnter, stdoutPrintOnExit, warn, warn, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface agg.attribute.AttrInstanceMember
getDeclaration, getExprAsObject, getExprAsText, isSet, setExpr
 
Methods inherited from interface agg.attribute.AttrMember
getHoldingTuple, getIndexInTuple, getName, getValidityReport, isValid
 
Methods inherited from interface agg.util.XMLObject
XreadObject, XwriteObject
 

Field Detail

LHS

public static final int LHS
Marking left hand side (LHS) of a rule

See Also:
Constant Field Values

RHS

public static final int RHS
Marking right hand side (RHS) of a rule

See Also:
Constant Field Values

NAC

public static final int NAC
Marking NAC of a rule

See Also:
Constant Field Values

PAC

public static final int PAC
See Also:
Constant Field Values

refCnt

protected int refCnt

isIn

protected boolean isIn

isOut

protected boolean isOut

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

VarMember

public VarMember(VarTuple tuple,
                 DeclMember decl)
Creating a new instance with the specified type.

Parameters:
tuple - Instance tuple that this value is a member of.
decl - Declaration for this member.
Method Detail

getErrorMsg

public java.lang.String getErrorMsg()
Overrides:
getErrorMsg in class ValueMember

delete

public void delete()
Removes this member from its tuple.

Specified by:
delete in interface AttrVariableMember

setEnabled

public void setEnabled(boolean b)

isEnabled

public boolean isEnabled()

isInputParameter

public boolean isInputParameter()
Description copied from interface: AttrVariableMember
Tests if this variable is an IN-parameter.

Specified by:
isInputParameter in interface AttrVariableMember

setInputParameter

public void setInputParameter(boolean in)
Description copied from interface: AttrVariableMember
Sets, if the variable is to be an IN-parameter.

Specified by:
setInputParameter in interface AttrVariableMember

isOutputParameter

public boolean isOutputParameter()
Description copied from interface: AttrVariableMember
Tests if this variable is an OUT-parameter.

Specified by:
isOutputParameter in interface AttrVariableMember

setOutputParameter

public void setOutputParameter(boolean out)
Description copied from interface: AttrVariableMember
Sets, if the variable is to be an OUT-parameter.

Specified by:
setOutputParameter in interface AttrVariableMember

getReferenceCount

public int getReferenceCount()

isUnifiableWith

public boolean isUnifiableWith(HandlerExpr srcExpr)

unifyWith

public boolean unifyWith(HandlerExpr srcExpr)

copy

public void copy(ValueMember fromInstance)
copy the contents of a single entry instance into another.

Overrides:
copy in class ValueMember

undoUnification

public void undoUnification()

setExprAsObject

public void setExprAsObject(java.lang.Object value)
                     throws AttrImplException
Description copied from class: ValueMember
Setting the value.

Specified by:
setExprAsObject in interface AttrInstanceMember
Overrides:
setExprAsObject in class ValueMember
Parameters:
value - Any object instance.
Throws:
AttrImplException

setExprAsText

public void setExprAsText(java.lang.String exprText)
                   throws AttrImplException
Description copied from class: ValueMember
Setting the value.

Specified by:
setExprAsText in interface AttrInstanceMember
Overrides:
setExprAsText in class ValueMember
Parameters:
exprText - textual expression representation;
Throws:
AttrImplException

setExprAsEvaluatedText

public void setExprAsEvaluatedText(java.lang.String exprText)
Description copied from class: ValueMember
Setting the value.

Specified by:
setExprAsEvaluatedText in interface AttrInstanceMember
Overrides:
setExprAsEvaluatedText in class ValueMember
Parameters:
exprText - textual expression representation;

getExpr

public HandlerExpr getExpr()
Description copied from interface: AttrInstanceMember
Retrieving the expression (value) contained in this member. The result can be queried and set according to the agg.attribute.handler.HandlerExpr interface.

Specified by:
getExpr in interface AttrInstanceMember
Overrides:
getExpr in class ValueMember

isDefinite

public boolean isDefinite()
Test, if the expression evaluates to a constant.

Specified by:
isDefinite in interface AttrVariableMember

setMark

public void setMark(int m)
The mark m defines a graph context of this variable . The graph context can be LHS, RHS or NAC.


getMark

public int getMark()

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Implementation of the only Observer interface method.

Specified by:
update in interface java.util.Observer
Overrides:
update in class AttrObject

getEvaluationResult

protected HandlerExpr getEvaluationResult()

startCount

protected void startCount()

incrementCount

protected void incrementCount()

decrementCount

protected void decrementCount()

toString

public java.lang.String toString()
Overrides:
toString in class ValueMember
Returns:
The textual representation of the expression or 'EMPTY_VALUE_SYMBOL' if that is null.