algoanim.primitives
Class ArrayMarker

java.lang.Object
  extended by algoanim.primitives.Primitive
      extended by algoanim.primitives.ArrayMarker

public class ArrayMarker
extends Primitive

Represents a marker which points to a certain array index.

Author:
Stephan Mehlhase

Field Summary
 
Fields inherited from class algoanim.primitives.Primitive
gen
 
Constructor Summary
ArrayMarker(ArrayMarkerGenerator amg, ArrayPrimitive prim, int index, java.lang.String name, DisplayOptions display, ArrayMarkerProperties ap)
          Instantiates the ArrayMarker and calls the create() method of the associated ArrayMarkerGenerator.
 
Method Summary
 void decrement(Timing delay, Timing duration)
          Decrements the given ArrayMarker by one position of the associated ArrayPrimitive.
 ArrayPrimitive getArray()
          Returns the associated ArrayPrimitive of this ArrayMarker.
 int getPosition()
          Returns the current index position of this ArrayMarker.
 ArrayMarkerProperties getProperties()
          Returns the properties of this ArrayMarker.
 void increment(Timing delay, Timing duration)
          Increments the given ArrayMarker by one position of the associated ArrayPrimitive.
 void move(int pos, Timing t, Timing d)
          Moves the ArrayMarker to the index specified by pos after the offset t.
 void moveBeforeStart(Timing t, Timing d)
          Moves the ArrayMarker out of of the referenced ArrayPrimitive after the offset t.
 void moveOutside(Timing t, Timing d)
          Moves the ArrayMarker out of of the referenced ArrayPrimitive after the offset t.
 void moveToEnd(Timing t, Timing d)
          Moves the ArrayMarker to the end of the referenced ArrayPrimitive after the offset t.
 void setName(java.lang.String newName)
          Sets the name of this Primitive.
 
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
 

Constructor Detail

ArrayMarker

public ArrayMarker(ArrayMarkerGenerator amg,
                   ArrayPrimitive prim,
                   int index,
                   java.lang.String name,
                   DisplayOptions display,
                   ArrayMarkerProperties ap)
Instantiates the ArrayMarker and calls the create() method of the associated ArrayMarkerGenerator.

Parameters:
amg - the appropriate code Generator.
prim - the ArrayPrimitive at which this marker shall point.
index - the index of the given ArrayPrimitive at which this marker shall point.
name - the name of this ArrayMarker.
display - [optional] the DisplayOptions of this ArrayMarker.
ap - [optional] the properties of this ArrayMarker.
Method Detail

decrement

public void decrement(Timing delay,
                      Timing duration)
Decrements the given ArrayMarker by one position of the associated ArrayPrimitive.

Parameters:
delay - the time to wait until the operation shall be performed.
duration - the duration of the operation.

increment

public void increment(Timing delay,
                      Timing duration)
Increments the given ArrayMarker by one position of the associated ArrayPrimitive. shall be moved.

Parameters:
delay - the time to wait until the operation shall be performed.
duration - the duration of the operation.

move

public void move(int pos,
                 Timing t,
                 Timing d)
Moves the ArrayMarker to the index specified by pos after the offset t. The operation will last as long as specified by the duration d.

Parameters:
pos - the index where to move the ArrayMarker.
t - [optional] the offset until this operation starts.
d - [optional] the duration of this operation.

moveBeforeStart

public void moveBeforeStart(Timing t,
                            Timing d)
Moves the ArrayMarker out of of the referenced ArrayPrimitive after the offset t. The operation will last as long as specified by the duration d.

Parameters:
t - [optional] the offset until this operation starts.
d - [optional] the duration of this operation.

moveToEnd

public void moveToEnd(Timing t,
                      Timing d)
Moves the ArrayMarker to the end of the referenced ArrayPrimitive after the offset t. The operation will last as long as specified by the duration d.

Parameters:
t - [optional] the offset until this operation starts.
d - [optional] the duration of this operation.

moveOutside

public void moveOutside(Timing t,
                        Timing d)
Moves the ArrayMarker out of of the referenced ArrayPrimitive after the offset t. The operation will last as long as specified by the duration d.

Parameters:
t - [optional] the offset until this operation starts.
d - [optional] the duration of this operation.

getArray

public ArrayPrimitive getArray()
Returns the associated ArrayPrimitive of this ArrayMarker.

Returns:
the associated ArrayPrimitive of this ArrayMarker.

getPosition

public int getPosition()
Returns the current index position of this ArrayMarker.

Returns:
the current index position of this ArrayMarker.

getProperties

public ArrayMarkerProperties getProperties()
Returns the properties of this ArrayMarker.

Returns:
the properties of this ArrayMarker.

setName

public void setName(java.lang.String newName)
Description copied from class: Primitive
Sets the name of this Primitive.

Overrides:
setName in class Primitive
Parameters:
newName - the new name for this Primitive.
See Also:
Primitive.setName(java.lang.String)