|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.data.Token
ptolemy.data.AbstractNotConvertibleToken
ptolemy.data.RecordToken
ptolemy.data.OrderedRecordToken
public class OrderedRecordToken
A token that contains a set of label/token pairs. Operations on record tokens result in new record tokens containing only the common fields, where the operation specifies how to combine the data in the common fields. Thus, for example, if two record tokens are added or subtracted, then common records (those with the same labels) will be added or subtracted, and the disjoint records will not appear in the result.
This implementation maintains the order of the entries as they were added.
red (leinfelder) |
yellow (leinfelder) |
Field Summary |
---|
Fields inherited from class ptolemy.data.RecordToken |
---|
_fields, EMPTY_RECORD |
Fields inherited from class ptolemy.data.Token |
---|
NIL |
Constructor Summary | |
---|---|
OrderedRecordToken()
Construct an OrderedRecordToke with now fields. |
|
OrderedRecordToken(java.util.Map fieldMap)
Construct an OrderedRecordToken with the labels and values specified by a given Map object. |
|
OrderedRecordToken(java.lang.String init)
Construct a RecordToken from the specified string. |
|
OrderedRecordToken(java.lang.String[] labels,
Token[] values)
Construct an OrderedRecordToken with the specified labels and values. |
Method Summary | |
---|---|
protected RecordToken |
_createRecordToken(java.lang.String[] labels,
Token[] values)
Create a new RecordToken. |
protected java.util.Set |
_createSet()
Create a Set implementation appropriate for operations on this RecordToken. |
protected void |
_initializeStorage()
Intialize the storage used by this token. |
protected BooleanToken |
_isEqualTo(Token rightArgument)
Return true if the specified token is equal to this one. |
boolean |
equals(java.lang.Object object)
Return true if the class of the argument is RecordToken, and the argument has the same set of labels as this token and the corresponding fields are equal, as determined by the equals method of the contained tokens. |
java.lang.String |
toString()
Return the value of this token as a string. |
Methods inherited from class ptolemy.data.RecordToken |
---|
_add, _divide, _isCloseTo, _modulo, _multiply, _subtract, get, getType, hashCode, labelSet, length, merge, mergeReturnType, one, zero |
Methods inherited from class ptolemy.data.AbstractNotConvertibleToken |
---|
add, addReverse, divide, divideReverse, isCloseTo, isEqualTo, modulo, moduloReverse, multiply, multiplyReverse, notSupportedDifferentClassesMessage, subtract, subtractReverse |
Methods inherited from class ptolemy.data.Token |
---|
isCloseTo, isNil, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, pow, zeroReturnType |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OrderedRecordToken()
RecordToken
public OrderedRecordToken(java.util.Map fieldMap) throws IllegalActionException
fieldMap
- A Map that has keys of type String and
values of type Token.
IllegalActionException
- If the map contains null
keys or values, or if it contains non-String keys or non-Token
values.public OrderedRecordToken(java.lang.String init) throws IllegalActionException
init
- A string expression of a record.
IllegalActionException
- If the string does not
contain a parsable record.public OrderedRecordToken(java.lang.String[] labels, Token[] values) throws IllegalActionException
labels
- An array of labels.values
- An array of Tokens.
IllegalActionException
- If the labels or the values array
do not have the same length, or contains null element,
or the labels array contains duplicate elements.Method Detail |
---|
public java.lang.String toString()
{label = value, label = value, ...}
The record fields are listed in the their original order
toString
in class RecordToken
public boolean equals(java.lang.Object object)
equals
in class RecordToken
object
- An instance of Object.
RecordToken.hashCode()
protected RecordToken _createRecordToken(java.lang.String[] labels, Token[] values) throws IllegalActionException
RecordToken
_createRecordToken
in class RecordToken
labels
- An array of String labels for the RecordToken to be created.values
- An array of Token values for the RecordToken to be created.
IllegalActionException
- If thrown while constructing the RecordTokenRecordToken
protected void _initializeStorage()
_initializeStorage
in class RecordToken
protected java.util.Set _createSet()
_createSet
in class RecordToken
protected BooleanToken _isEqualTo(Token rightArgument) throws IllegalActionException
_isEqualTo
in class RecordToken
rightArgument
- The token to compare to this token.
IllegalActionException
- If this method is not
supported by the derived class.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |