agg.attribute.impl
Class CondTuple

java.lang.Object
  extended by agg.attribute.impl.AttrObject
      extended by agg.attribute.impl.ManagedObject
          extended by agg.attribute.impl.ChainedObserver
              extended by agg.attribute.impl.TupleObject
                  extended by agg.attribute.impl.ValueTuple
                      extended by agg.attribute.impl.LoneTuple
                          extended by agg.attribute.impl.CondTuple
All Implemented Interfaces:
AttrConditionTuple, AttrInstance, AttrObserver, AttrTuple, AttrMsgCode, Disposable, XMLObject, java.io.Serializable, java.util.Observer

public class CondTuple
extends LoneTuple
implements AttrConditionTuple, AttrMsgCode

Application conditions. Every instance of ContextCore has exactly one instance of this class.

See Also:
Serialized Form

Field Summary
protected static java.lang.String boolHandlerName
          Name of the handler for the boolean type.
protected  HandlerType boolType
          Boolean type.
protected static java.lang.String boolTypeName
          Constant for the boolean type name.
protected  AttrHandler condHandler
          Attribute handler for condition expressions.
protected  int condNum
          Current condition number, is used to compose unique names within one condition tuple.
protected static java.lang.String falseVal
          Constant for the false value.
protected static java.lang.String namePrefix
          Constant prefix for the condition entry names.
protected static java.lang.String trueVal
          Constant for the true value.
 
Fields inherited from class agg.attribute.impl.ValueTuple
errorMsg, type
 
Fields inherited from class agg.attribute.impl.TupleObject
members, parent
 
Fields inherited from class agg.attribute.impl.ChainedObserver
MAX_SIZE_OF_EVENT_STACK, sizeOfEventStack
 
Fields inherited from class agg.attribute.impl.ManagedObject
manager
 
Fields inherited from class agg.attribute.impl.AttrObject
classHandlerExpr, classObject, classString, initialized
 
Fields inherited from interface agg.attribute.AttrConditionTuple
serialVersionUID
 
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
 
Fields inherited from interface agg.attribute.AttrObserver
serialVersionUID
 
Constructor Summary
CondTuple(AttrTupleManager manager, ContextView context, CondTuple parent)
           
 
Method Summary
 AttrConditionMember addCondition(java.lang.String expr)
          Adding of a condition member, returning the member.
 void clear()
           
 boolean compareTo(AttrInstance another)
           
 boolean contains(java.lang.String expr)
          Test, if expr is member of a condition tuple.
 void dispose()
          Prepare myself for garbage collection.
 java.util.Vector<java.lang.String> getAllVariables()
          Getting all variable names of conditions.
 CondMember getCondMemberAt(int index)
           
 java.lang.String getFailedConditionAsString()
           
protected  java.lang.String getNameFor(int index)
           
protected  java.lang.String getNextName()
           
protected  void initClass()
           
 boolean isDefinite()
          Test, if all members can yield true or false.
 boolean isDefinite(java.lang.String name)
          Test, if name can yield true or false.
 boolean isEvaluable(VarTuple vars)
           
 boolean isFalse()
          Test, if the tuple contains members which can be evaluated and yield 'false'.
 boolean isFalse(java.lang.String name)
          Test, if the tuple contains members which can be evaluated and yield 'false'.
 boolean isTrue()
          Test, if ANDing of all members yields true.
 boolean isTrue(java.lang.String name)
          Test, if ANDing of all members yields true.
 void makeCopyOf(CondTuple tuple)
           
protected  ValueMember newMember(DeclMember decl)
          Generic component creation.
 void setVariableContext(boolean b)
           
 void showConditions()
           
 boolean usesVariable(java.lang.String var)
           
 void XreadObject(XMLHelper h)
           
 void XwriteObject(XMLHelper h)
           
 
Methods inherited from class agg.attribute.impl.ValueTuple
adaptToType, adoptEntriesWhereEmpty, apply, apply, apply, apply, apply, apply, assignParent, canMatchChild2Parent, canMatchTo, copy, copyEntries, copyEntriesToSimilarMembers, getAllVariableNames, getAllVariableNamesOfExpressions, getContext, getContextView, getEntryAt, getEntryAt, getEntryWithValueAsText, getErrorMsg, getLogEntry, getNumberOfFreeVariables, getTupleType, getValueAsString, getValueAt, getValueMemberAt, getValueMemberAt, isEmpty, isValueSetAt, isValueSetAt, log, logPrintln, matchChild2Parent, matchTo, propagateEvent, refreshParents, setContextView, setExprAt, setExprValueAt, setType, setValueAt, setValueAt, setValueAt, showValue, toString, unsetValue, updateMemberAdded, updateMemberDeleted, updateMemberRetyped, updateMemberValueChanged
 
Methods inherited from class agg.attribute.impl.TupleObject
addMember, addMember, deleteMemberAt, ensureNonNull, finalize, getForm, getIndexForMember, getIndexForName, getIndexInView, getMemberAt, getMemberAt, getMemberAt, getNameAsString, getNameAsString, getNumberOfEntries, getNumberOfEntries, getParent, getParentInCharge, getParentSize, getSize, getType, getTypeAsString, getTypeAsString, getValueAsString, isSubclassOf, isValid, memberChanged, rawAddMember, rawAddMember, rawDeleteMemberAt, rawGetMemberAt, rawGetSize, setForm
 
Methods inherited from class agg.attribute.impl.ChainedObserver
addObserver, addObserverAtPos, attributeChanged, contains, filterEvent, findObserver, fireAttrChanged, fireAttrChanged, fireAttrChanged, getObservers, isPersistentFor, removeObserver, updateGeneralChange, updateMemberModified, updateMemberRenamed, updateUnknownChange, updateValueCorrectness, updateValueModified
 
Methods inherited from class agg.attribute.impl.ManagedObject
getAttrManager, getManager
 
Methods inherited from class agg.attribute.impl.AttrObject
defaultToString, err, err, getInstRepr, log, log, logEnteredMethod, logPrintln, stdoutPrintOnEnter, stdoutPrintOnExit, update, warn, warn, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface agg.attribute.AttrInstance
apply, apply, apply, apply, copy, copyEntries, getContext, getNumberOfFreeVariables, getType, getValueAt, isValueSetAt, setExprAt, setExprValueAt, setValueAt, unsetValue
 
Methods inherited from interface agg.attribute.AttrTuple
addObserver, getAttrManager, getIndexForMember, getMemberAt, getMemberAt, getMemberAt, getNameAsString, getNameAsString, getNumberOfEntries, getNumberOfEntries, getTupleType, getTypeAsString, getTypeAsString, getValueAsString, getValueAsString, isValid, removeObserver
 

Field Detail

boolHandlerName

protected static java.lang.String boolHandlerName
Name of the handler for the boolean type.


boolTypeName

protected static final java.lang.String boolTypeName
Constant for the boolean type name.

See Also:
Constant Field Values

trueVal

protected static final java.lang.String trueVal
Constant for the true value.

See Also:
Constant Field Values

falseVal

protected static final java.lang.String falseVal
Constant for the false value.

See Also:
Constant Field Values

namePrefix

protected static final java.lang.String namePrefix
Constant prefix for the condition entry names.

See Also:
Constant Field Values

condHandler

protected AttrHandler condHandler
Attribute handler for condition expressions.


boolType

protected HandlerType boolType
Boolean type.


condNum

protected int condNum
Current condition number, is used to compose unique names within one condition tuple.

Constructor Detail

CondTuple

public CondTuple(AttrTupleManager manager,
                 ContextView context,
                 CondTuple parent)
Method Detail

initClass

protected void initClass()

clear

public void clear()

dispose

public void dispose()
Description copied from interface: Disposable
Prepare myself for garbage collection.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class TupleObject

makeCopyOf

public void makeCopyOf(CondTuple tuple)

getNextName

protected java.lang.String getNextName()

getNameFor

protected java.lang.String getNameFor(int index)

newMember

protected ValueMember newMember(DeclMember decl)
Generic component creation.

Overrides:
newMember in class ValueTuple

getCondMemberAt

public CondMember getCondMemberAt(int index)

addCondition

public AttrConditionMember addCondition(java.lang.String expr)
Description copied from interface: AttrConditionTuple
Adding of a condition member, returning the member. For deletion, see agg.attribute.AttrConditionMember.

Specified by:
addCondition in interface AttrConditionTuple

isDefinite

public boolean isDefinite()
Test, if all members can yield true or false.

Specified by:
isDefinite in interface AttrConditionTuple

isDefinite

public boolean isDefinite(java.lang.String name)
Test, if name can yield true or false.


contains

public boolean contains(java.lang.String expr)
Test, if expr is member of a condition tuple.


isEvaluable

public boolean isEvaluable(VarTuple vars)

isTrue

public boolean isTrue()
Test, if ANDing of all members yields true.

Specified by:
isTrue in interface AttrConditionTuple

isTrue

public boolean isTrue(java.lang.String name)
Test, if ANDing of all members yields true.


isFalse

public boolean isFalse()
Test, if the tuple contains members which can be evaluated and yield 'false'.

Specified by:
isFalse in interface AttrConditionTuple

isFalse

public boolean isFalse(java.lang.String name)
Test, if the tuple contains members which can be evaluated and yield 'false'.


getFailedConditionAsString

public java.lang.String getFailedConditionAsString()

setVariableContext

public void setVariableContext(boolean b)

getAllVariables

public java.util.Vector<java.lang.String> getAllVariables()
Description copied from interface: AttrConditionTuple
Getting all variable names of conditions.

Specified by:
getAllVariables in interface AttrConditionTuple

usesVariable

public boolean usesVariable(java.lang.String var)

compareTo

public boolean compareTo(AttrInstance another)
Specified by:
compareTo in interface AttrInstance
Overrides:
compareTo in class ValueTuple

showConditions

public void showConditions()

XwriteObject

public void XwriteObject(XMLHelper h)
Specified by:
XwriteObject in interface XMLObject
Overrides:
XwriteObject in class ValueTuple

XreadObject

public void XreadObject(XMLHelper h)
Specified by:
XreadObject in interface XMLObject
Overrides:
XreadObject in class ValueTuple