|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgoanim.primitives.Primitive
algoanim.primitives.ArrayPrimitive
algoanim.primitives.IntArray
public class IntArray
IntArray manages an internal array. Operations on
objects of IntArray are almost performed like on a simple
array.
| Field Summary | |
|---|---|
protected IntArrayGenerator |
generator
The related IntArrayGenerator, which is responsible for
generating the appropriate scriptcode for operations performed on
this object. |
| Fields inherited from class algoanim.primitives.ArrayPrimitive |
|---|
length |
| Fields inherited from class algoanim.primitives.Primitive |
|---|
gen |
| Constructor Summary | |
|---|---|
IntArray(IntArrayGenerator iag,
Node upperLeftCorner,
int[] arrayData,
java.lang.String name,
ArrayDisplayOptions display,
ArrayProperties iap)
Instantiates the IntArray and calls the create() method
of the associated IntArrayGenerator. |
|
| Method Summary | |
|---|---|
int[] |
getData()
Returns the internal int array. |
int |
getData(int i)
Returns the data at the given position of the internal array. |
ArrayProperties |
getProperties()
Returns the properties of this array. |
Node |
getUpperLeft()
Returns the upper left corner of this array. |
void |
highlightCell(int from,
int to,
Timing offset,
Timing duration)
Highlights a range of array cells. |
void |
highlightCell(int position,
Timing offset,
Timing duration)
Highlights the array cell at a given position after a distinct offset. |
void |
highlightElem(int from,
int to,
Timing offset,
Timing duration)
Highlights a range of array elements. |
void |
highlightElem(int position,
Timing offset,
Timing duration)
Highlights the array element at a given position after a distinct offset. |
void |
put(int where,
int what,
Timing t,
Timing d)
Puts the value what at position where. |
void |
setName(java.lang.String newName)
Sets the name of this Primitive. |
void |
swap(int what,
int with,
Timing t,
Timing d)
Swaps the elements at index what and
with. |
void |
unhighlightCell(int from,
int to,
Timing offset,
Timing duration)
Unhighlights a range of array cells. |
void |
unhighlightCell(int position,
Timing offset,
Timing duration)
Unhighlights the array cell at a given position after a distinct offset. |
void |
unhighlightElem(int from,
int to,
Timing offset,
Timing duration)
Unhighlights a range of array elements. |
void |
unhighlightElem(int position,
Timing offset,
Timing duration)
Unhighlights the array element at a given position after a distinct offset. |
| Methods inherited from class algoanim.primitives.ArrayPrimitive |
|---|
getLength |
| 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 IntArrayGenerator generator
IntArrayGenerator, which is responsible for
generating the appropriate scriptcode for operations performed on
this object.
| Constructor Detail |
|---|
public IntArray(IntArrayGenerator iag,
Node upperLeftCorner,
int[] arrayData,
java.lang.String name,
ArrayDisplayOptions display,
ArrayProperties iap)
IntArray and calls the create() method
of the associated IntArrayGenerator.
iag - the appropriate code Generator.upperLeftCorner - the upper left corner of this
IntArray.arrayData - the data of this IntArray.name - the name of this IntArray.display - [optional] the DisplayOptions of this
IntArray.iap - [optional] the properties of this IntArray.| Method Detail |
|---|
public void put(int where,
int what,
Timing t,
Timing d)
throws java.lang.IndexOutOfBoundsException
what at position where.
This is the delayed version as specified by t.
The duration of this operation may also be specified.
where - the index 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 what,
int with,
Timing t,
Timing d)
throws java.lang.IndexOutOfBoundsException
what and
with.
This is the delayed version. The duration of this
operation may also be specified.
swap in class ArrayPrimitivewhat - first element to swap.with - 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 array.
int array.
public int getData(int i)
throws java.lang.IndexOutOfBoundsException
i - the position where to look for the data.
i in the internal
int array.
java.lang.IndexOutOfBoundsExceptionpublic Node getUpperLeft()
public ArrayProperties 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 position,
Timing offset,
Timing duration)
position - the position 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 highlightCell(int from,
int to,
Timing offset,
Timing duration)
from - the start of the interval to highlight.to - the end 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 position,
Timing offset,
Timing duration)
position - the 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 unhighlightCell(int from,
int to,
Timing offset,
Timing duration)
from - the start of the interval to unhighlight.to - the end of the interval to unhighlight.offset - [optional] the offset after which the operation shall be
started.duration - [optional] the duration this operation lasts.
public void highlightElem(int position,
Timing offset,
Timing duration)
position - the position 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 highlightElem(int from,
int to,
Timing offset,
Timing duration)
from - the start of the interval to highlight.to - the end 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 unhighlightElem(int position,
Timing offset,
Timing duration)
position - the position 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 unhighlightElem(int from,
int to,
Timing offset,
Timing duration)
from - the start of the interval to unhighlight.to - the end of the 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 | |||||||||