|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object extended byptolemy.data.Token extended byptolemy.data.MatrixToken extended byptolemy.data.BooleanMatrixToken
A token that contains a 2-D boolean matrix.
| Field Summary |
| Fields inherited from class ptolemy.data.MatrixToken |
_nils, DO_COPY, DO_NOT_COPY |
| Fields inherited from class ptolemy.data.Token |
NIL |
| Constructor Summary | |
BooleanMatrixToken()
Construct an BooleanMatrixToken with a one by one matrix. |
|
BooleanMatrixToken(boolean[][] value)
Construct a BooleanMatrixToken with the specified 2-D matrix. |
|
BooleanMatrixToken(java.lang.String init)
Construct a BooleanMatrixToken from the specified string. |
|
BooleanMatrixToken(Token[] tokens,
int rows,
int columns)
Construct an BooleanMatrixToken from the specified array of tokens. |
|
| Method Summary | |
protected boolean[][] |
_createIdentity(int dim)
Return an new identity matrix with the specified dimension. |
boolean[][] |
booleanMatrix()
Return a copy of the contained 2-D matrix. |
static BooleanMatrixToken |
convert(Token token)
Convert the specified token into an instance of BooleanMatrixToken. |
boolean |
equals(java.lang.Object object)
Return true if the argument is an instance of BooleanMatrixToken of the same dimensions and the corresponding elements of the matrices are equal. |
int |
getColumnCount()
Return the number of columns in the matrix. |
Token |
getElementAsToken(int row,
int column)
Return the element of the matrix at the specified row and column in a BooleanToken. |
boolean |
getElementAt(int row,
int column)
Return the element of the contained matrix at the specified row and column. |
Type |
getElementType()
Return the Type of the tokens contained in this matrix token. |
int |
getRowCount()
Return the number of rows in the matrix. |
Type |
getType()
Return the type of this token. |
int |
hashCode()
Return a hash code value for this token. |
Token |
one()
Return a new Token representing the left multiplicative identity. |
Token |
oneRight()
Return a new Token representing the right multiplicative identity. |
Token |
zero()
Return a new Token representing the additive identity. |
| 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 BooleanMatrixToken()
public BooleanMatrixToken(boolean[][] value) throws IllegalActionException
value - The 2-D boolean matrix.
IllegalActionException - If the specified matrix
is null.public BooleanMatrixToken(java.lang.String init) throws IllegalActionException
init - A string expression of a boolean matrix.
IllegalActionException - If the string does
not contain a parsable boolean matrix.public BooleanMatrixToken(Token[] tokens, int rows, int columns) throws IllegalActionException
tokens - The array of tokens, which must contains
rows*columns BooleanTokens.rows - The number of rows in the matrix to be created.columns - The number of columns in the matrix to be
created.
IllegalActionException - If the array of tokens is
null, or the length of the array is not correct, or if one of
the elements of the array is null, or if one of the elements
of the array cannot be losslessly converted to a boolean.| Method Detail |
public boolean[][] booleanMatrix()
public static BooleanMatrixToken convert(Token token) throws IllegalActionException
token - The token to be converted to a BooleanMatrixToken.
IllegalActionException - If the conversion cannot
be carried out.public boolean equals(java.lang.Object object)
object - An instance of Object.
public int getColumnCount()
getColumnCount in class MatrixTokenpublic Token getElementAsToken(int row, int column) throws java.lang.ArrayIndexOutOfBoundsException
getElementAsToken in class MatrixTokenrow - The row index of the desired element.column - The column index of the desired element.
java.lang.ArrayIndexOutOfBoundsException - If the specified
row or column number is outside the range of the matrix.public boolean getElementAt(int row, int column)
row - The row index of the desired element.column - The column index of the desired element.
java.lang.ArrayIndexOutOfBoundsException - If the specified
row or column number is outside the range of the matrix.public Type getElementType()
getElementType in class MatrixTokenpublic int getRowCount()
getRowCount in class MatrixTokenpublic Type getType()
public int hashCode()
public Token one()
public Token oneRight()
oneRight in class MatrixTokenpublic Token zero()
protected boolean[][] _createIdentity(int dim)
dim - The dimension
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||