|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgoanim.primitives.Primitive
algoanim.primitives.MatrixPrimitive
algoanim.primitives.IntMatrix
public class IntMatrix
IntMatrix manages an internal matrix. Operations on objects of
IntMatrix are almost performed like on a simple matrix.
| Field Summary | |
|---|---|
protected IntMatrixGenerator |
generator
The related IntMatrixGenerator, which is responsible for
generating the appropriate scriptcode for operations performed on this
object. |
| Fields inherited from class algoanim.primitives.MatrixPrimitive |
|---|
nrCols, nrRows |
| Fields inherited from class algoanim.primitives.Primitive |
|---|
gen |
| Constructor Summary | |
|---|---|
IntMatrix(IntMatrixGenerator iag,
Node upperLeftCorner,
int[][] matrixData,
java.lang.String name,
DisplayOptions display,
MatrixProperties iap)
Instantiates the IntMatrix and calls the create() method of
the associated IntMatrixGenerator. |
|
| Method Summary | |
|---|---|
int[][] |
getData()
Returns the internal int matrix. |
int |
getElement(int row,
int col)
|
MatrixProperties |
getProperties()
Returns the properties of this matrix. |
int[] |
getRow(int row)
Returns the data at the given position of the internal matrix. |
Node |
getUpperLeft()
Returns the upper left corner of this matrix. |
void |
highlightCell(int row,
int col,
Timing offset,
Timing duration)
Highlights the matrix cell at a given position after a distinct offset. |
void |
highlightCellColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
Highlights a range of array cells of an IntMatrix. |
void |
highlightCellRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
Highlights a range of array cells of an IntMatrix. |
void |
highlightElem(int row,
int col,
Timing offset,
Timing duration)
Highlights the matrix element at a given position after a distinct offset. |
void |
highlightElemColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
Highlights a range of matrix elements. |
void |
highlightElemRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
Highlights a range of array elements of an IntMatrix. |
void |
put(int row,
int col,
int what,
Timing t,
Timing d)
Puts the value what at position [row][col]. |
void |
setName(java.lang.String newName)
Sets the name of this Primitive. |
void |
swap(int sourceRow,
int sourceCol,
int targetRow,
int targetCol,
Timing t,
Timing d)
Swaps the elements at index [sourceRow][sourceCol] and
[targetRow][targetCol]. |
void |
unhighlightCell(int row,
int col,
Timing offset,
Timing duration)
Unhighlights the array cell of an IntMatrix at a given
position after a distinct offset. |
void |
unhighlightCellColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
Unhighlights a range of array cells of an IntMatrix. |
void |
unhighlightCellRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
Unhighlights a range of array cells of an IntMatrix. |
void |
unhighlightElem(int row,
int col,
Timing offset,
Timing duration)
Unhighlights the matrix element at a given position after a distinct offset. |
void |
unhighlightElemColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
Unhighlights a range of array elements of an IntMatrix. |
void |
unhighlightElemRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
Unhighlights a range of array elements of an IntMatrix. |
| Methods inherited from class algoanim.primitives.MatrixPrimitive |
|---|
getNrCols, getNrRows |
| Methods inherited from class algoanim.primitives.Primitive |
|---|
changeColor, exchange, getDisplayOptions, getName, hide, hide, moveBy, moveTo, moveVia, rotate, rotate, show, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected IntMatrixGenerator generator
IntMatrixGenerator, which is responsible for
generating the appropriate scriptcode for operations performed on this
object.
| Constructor Detail |
|---|
public IntMatrix(IntMatrixGenerator iag,
Node upperLeftCorner,
int[][] matrixData,
java.lang.String name,
DisplayOptions display,
MatrixProperties iap)
IntMatrix and calls the create() method of
the associated IntMatrixGenerator.
iag - the appropriate code Generator.upperLeftCorner - the upper left corner of this IntMatrix.matrixData - the data of this IntMatrix.name - the name of this IntMatrix.display - [optional] the DisplayOptions of this
IntMatrix.iap - [optional] the properties of this IntMatrix.| Method Detail |
|---|
public int getElement(int row,
int col)
public void put(int row,
int col,
int what,
Timing t,
Timing d)
throws java.lang.IndexOutOfBoundsException
what at position [row][col].
This is the delayed version as specified by t. The
duration of this operation may also be specified.
row - the row position of the element to write.col - the column position of the element to write.what - the new value.t - [optional] the delay which shall be applied to the operation.d - [optional] the duration this action needs.
java.lang.IndexOutOfBoundsException
public void swap(int sourceRow,
int sourceCol,
int targetRow,
int targetCol,
Timing t,
Timing d)
throws java.lang.IndexOutOfBoundsException
[sourceRow][sourceCol] and
[targetRow][targetCol]. This is the delayed version. The
duration of this operation may also be specified.
sourceRow - the row position of the first element to swap.sourceCol - the column position of the first element to swap.targetRow - the row position of the second element to swap.targetCol - the column position of the second element to swap.t - [optional] the delay which shall be applied to the operation.d - [optional] the duration this action needs.
java.lang.IndexOutOfBoundsExceptionpublic int[][] getData()
int matrix.
int matrix.
public int[] getRow(int row)
throws java.lang.IndexOutOfBoundsException
row - the position where to look for the data.
i in the internal
int matrix.
java.lang.IndexOutOfBoundsExceptionpublic Node getUpperLeft()
public MatrixProperties getProperties()
public void setName(java.lang.String newName)
PrimitivePrimitive.
setName in class PrimitivenewName - the new name for this Primitive.Primitive.setName(java.lang.String)
public void highlightCell(int row,
int col,
Timing offset,
Timing duration)
row - the row of the cell to highlight.col - the column of the cell to highlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void highlightCellColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
IntMatrix.
row - the row of the interval to highlight.startCol - the start column of the interval to highlight.endCol - the end column of the interval to highlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void highlightCellRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
IntMatrix.
startRow - the start row of the interval to highlight.endRow - the end row of the interval to highlight.col - the column of the interval to highlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void unhighlightCell(int row,
int col,
Timing offset,
Timing duration)
IntMatrix at a given
position after a distinct offset.
row - the row position of the cell to unhighlight.col - the column position of the cell to unhighlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void unhighlightCellColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
IntMatrix.
row - the row of the interval to highlight.startCol - the start column of the interval to highlight.endCol - the end column of the interval to highlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void unhighlightCellRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
IntMatrix.
startRow - the start row of the interval to highlight.endRow - the end row of the interval to highlight.col - the column of the interval to highlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void highlightElem(int row,
int col,
Timing offset,
Timing duration)
row - the row of the element to highlight.col - the column of the element to highlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void highlightElemColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
row - the row of the interval to highlight.startCol - the start of the column interval to highlight.endCol - the end of the column interval to highlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void highlightElemRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
IntMatrix.
startRow - the start of the row interval to highlight.endRow - the end of the row interval to highlight.col - the column interval to highlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void unhighlightElem(int row,
int col,
Timing offset,
Timing duration)
row - the row of the element to unhighlight.col - the column of the element to unhighlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void unhighlightElemColumnRange(int row,
int startCol,
int endCol,
Timing offset,
Timing duration)
IntMatrix.
row - the row of the interval to unhighlight.startCol - the start of the column interval to unhighlight.endCol - the end of the column interval to unhighlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
public void unhighlightElemRowRange(int startRow,
int endRow,
int col,
Timing offset,
Timing duration)
IntMatrix.
startRow - the start row of the interval to unhighlight.endRow - the end row of the interval to unhighlight.col - the column interval to unhighlight.offset - [optional] the offset after which the operation shall be started.duration - [optional] the duration this operation lasts.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||