* @exception IllegalActionException If the indexes vector is not
* increasing and nonnegative, or the indexes is not a row vector.
*/
public void attributeChanged(Attribute attribute) throws IllegalActionException {
if (attribute == indexes) {
ArrayToken indexesValue = (ArrayToken)indexes.getToken();
$ASSIGN$_indexes(new int[indexesValue.length()]);
int previous = 0;
for (int i = 0; i < indexesValue.length(); i++) {
$ASSIGN$_indexes(i, ((IntToken)indexesValue.getElement(i)).intValue());
if (_indexes[i] < previous) {
throw new IllegalActionException(this, "Value of indexes is not nondecreasing " + "and nonnegative.");
}
previous = _indexes[i];
}
} else if (attribute == values) {
try {
ArrayToken valuesArray = (ArrayToken)values.getToken();
Token prototype = valuesArray.getElement(0);
$ASSIGN$_zero(prototype.zero());
} catch (ArrayIndexOutOfBoundsException ex) {
throw new IllegalActionException(this, "Cannot set values to an empty array.");
} catch (ClassCastException ex) {
throw new IllegalActionException(this, "Cannot set values to something that is not an array: " + values.getToken());