agg.attribute.impl
Class TupleMapping

java.lang.Object
  extended by agg.attribute.impl.AttrObject
      extended by agg.attribute.impl.TupleMapping
All Implemented Interfaces:
AttrMapping, AttrMsgCode, java.io.Serializable, java.util.Observer

public class TupleMapping
extends AttrObject
implements AttrMapping, AttrMsgCode

Representation of a mapping between two attribute instances.

See Also:
Serialized Form

Field Summary
protected  java.lang.String[] assignedVariables
          References to value settings done due to this mapping.
protected  ContextView context
          The context this mapping is contained in.
protected  ValueTuple source
          The source and target objects of this mapping.
protected  ValueTuple target
          The source and target objects of this mapping.
 
Fields inherited from class agg.attribute.impl.AttrObject
classHandlerExpr, classObject, classString, initialized
 
Fields inherited from interface agg.attribute.AttrMapping
GRAPH_MAP, MATCH_MAP, PLAIN_MAP
 
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
TupleMapping(ContextView mappingContext, ValueTuple src, ValueTuple tar)
          All or nothing: tries to create a mapping right away, with matching if it's in a match context.
 
Method Summary
 void adoptEntriesWhereEmpty(ValueTuple src, ValueTuple tar)
          This method accepts AttrMapping.PLAIN_MAP only.
protected  java.lang.String getAllowedMappingAsString(ContextView contextview)
          For debugging output.
 java.util.Vector<java.lang.String> getAssignedVariables()
           
 ValueTuple getSource()
          Getting the source attribute instance.
 ValueTuple getTarget()
          Getting the target attribute instance.
 boolean next()
          Use the next possible mapping;
 void remove()
          Implementation of agg.attribute.AttrMapping#remove().
 void removeNow()
          Called from this mapping's context; Discard mapping; Removes assignments made by it from its context.
 
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

source

protected ValueTuple source
The source and target objects of this mapping.


target

protected ValueTuple target
The source and target objects of this mapping.


context

protected ContextView context
The context this mapping is contained in.


assignedVariables

protected java.lang.String[] assignedVariables
References to value settings done due to this mapping. (Vector of Object)

Constructor Detail

TupleMapping

public TupleMapping(ContextView mappingContext,
                    ValueTuple src,
                    ValueTuple tar)
All or nothing: tries to create a mapping right away, with matching if it's in a match context. If it fails, an 'AttrImplException' is thrown.

Method Detail

adoptEntriesWhereEmpty

public void adoptEntriesWhereEmpty(ValueTuple src,
                                   ValueTuple tar)
This method accepts AttrMapping.PLAIN_MAP only.


getAssignedVariables

public java.util.Vector<java.lang.String> getAssignedVariables()

next

public boolean next()
Use the next possible mapping;

Specified by:
next in interface AttrMapping
Returns:
"true" if more subsequent mappings exist, "false" otherwise.

remove

public void remove()
Implementation of agg.attribute.AttrMapping#remove(). Called by a client. Discards mapping; Actually only telling the context that this mapping shall be removed; The context chooses when exactly this occurs and then calls #removeNow .

Specified by:
remove in interface AttrMapping

removeNow

public void removeNow()
Called from this mapping's context; Discard mapping; Removes assignments made by it from its context.


getSource

public ValueTuple getSource()
Getting the source attribute instance.


getTarget

public ValueTuple getTarget()
Getting the target attribute instance.


getAllowedMappingAsString

protected java.lang.String getAllowedMappingAsString(ContextView contextview)
For debugging output.