public class UpdatedArrayToken extends ArrayToken
This technique is inspired by a similar technique of storing diffs described by Michael Isard in a talk at Berkeley in February, 2012.
| Red (cxh) nil token code |
| Yellow (cxh) |
_depth, _elementType, NIL| Constructor and Description |
|---|
UpdatedArrayToken(ArrayToken baseToken,
int index,
Token newValue)
Construct an UpdatedArrayToken that is equal to the specified
baseToken, except at index, where its value is
newValue.
|
| Modifier and Type | Method and Description |
|---|---|
Token |
getElement(int index)
Return the element at the specified index.
|
int |
length()
Return the length of the contained token array.
|
_add, _divide, _divideReverse, _isCloseTo, _isEqualTo, _modulo, _moduloReverse, _multiply, _subtract, _subtractReverse, add, addReverse, append, append, arrayTokenToUnsignedByteArray, arrayValue, contains, divide, divideReverse, elementAdd, elementDivide, elementModulo, elementMultiply, elementMultiplyReturnType, elementSubtract, equals, extract, getElementType, getType, hashCode, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, one, reverse, subarray, subarray, subtract, subtractReverse, toString, unsignedByteArrayToArrayToken, update, zeroisEqualTo, notSupportedDifferentClassesMessageisCloseTo, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, pow, zeroReturnTypepublic UpdatedArrayToken(ArrayToken baseToken, int index, Token newValue) throws IllegalActionException
baseToken - The base array.index - The index of the new value.newValue - The updated value.IllegalActionException - If the index is out of range
for the base token.public Token getElement(int index)
getElement in class ArrayTokenindex - The index of the desired element.java.lang.ArrayIndexOutOfBoundsException - If the specified index is
outside the range of the token array.public int length()
length in class ArrayToken