algoanim.animalscript
Class AnimalArrayBasedStackGenerator<T>

java.lang.Object
  extended by algoanim.primitives.generators.Generator
      extended by algoanim.animalscript.AnimalGenerator
          extended by algoanim.animalscript.AnimalArrayBasedStackGenerator<T>
All Implemented Interfaces:
ArrayBasedStackGenerator<T>, GeneratorInterface

public class AnimalArrayBasedStackGenerator<T>
extends AnimalGenerator
implements ArrayBasedStackGenerator<T>

Author:
Dima Vronskyi

Field Summary
 
Fields inherited from class algoanim.primitives.generators.Generator
lang
 
Constructor Summary
AnimalArrayBasedStackGenerator(Language aLang)
           
 
Method Summary
 void create(ArrayBasedStack<T> abs)
          Creates the originating script code for a given ArrayBasedStack, due to the fact that before a primitive can be worked with it has to be defined and made known to the script language.
 void highlightTopCell(ArrayBasedStack<T> abs, Timing delay, Timing duration)
          Highlights the cell which contains the top element of the given ArrayBasedStack.
 void highlightTopElem(ArrayBasedStack<T> abs, Timing delay, Timing duration)
          Highlights the top element of the given ArrayBasedStack.
 void isEmpty(ArrayBasedStack<T> abs, Timing delay, Timing duration)
          Tests if the given ArrayBasedStack is empty.
 void isFull(ArrayBasedStack<T> abs, Timing delay, Timing duration)
          Tests if the given ArrayBasedStack is full.
 void pop(ArrayBasedStack<T> abs, Timing delay, Timing duration)
          Removes the element at the top of the given ArrayBasedStack.
 void push(ArrayBasedStack<T> abs, T elem, Timing delay, Timing duration)
          Pushes the element elem onto the top of the given ArrayBasedStack.
 void top(ArrayBasedStack<T> abs, Timing delay, Timing duration)
          Retrieves (without removing) the element at the top of the given ArrayBasedStack.
 void unhighlightTopCell(ArrayBasedStack<T> abs, Timing delay, Timing duration)
          Unhighlights the cell which contains the top element of the given ArrayBasedStack.
 void unhighlightTopElem(ArrayBasedStack<T> abs, Timing delay, Timing duration)
          Unhighlights the top element of the given ArrayBasedStack.
 
Methods inherited from class algoanim.animalscript.AnimalGenerator
addBooleanOption, addBooleanSwitch, addColorOption, addColorOption, addFontOption, addFontOption, addIntOption, addWithTiming, changeColor, exchange, hide, makeColorDef, makeColorDef, makeDisplayOptionsDef, makeDisplayOptionsDef, makeDurationTimingDef, makeHiddenDef, makeNodeDef, makeOffsetTimingDef, moveBy, moveTo, moveVia, rotate, rotate, show
 
Methods inherited from class algoanim.primitives.generators.Generator
getLanguage, isNameUsed, isValidDirection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface algoanim.primitives.generators.GeneratorInterface
changeColor, exchange, getLanguage, hide, moveBy, moveTo, moveVia, rotate, rotate, show
 

Constructor Detail

AnimalArrayBasedStackGenerator

public AnimalArrayBasedStackGenerator(Language aLang)
Method Detail

create

public void create(ArrayBasedStack<T> abs)
Description copied from interface: ArrayBasedStackGenerator
Creates the originating script code for a given ArrayBasedStack, due to the fact that before a primitive can be worked with it has to be defined and made known to the script language.

Specified by:
create in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack for which the initiate script code shall be created.

isFull

public void isFull(ArrayBasedStack<T> abs,
                   Timing delay,
                   Timing duration)
Description copied from interface: ArrayBasedStackGenerator
Tests if the given ArrayBasedStack is full.

Specified by:
isFull in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack which is tested.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

pop

public void pop(ArrayBasedStack<T> abs,
                Timing delay,
                Timing duration)
Description copied from interface: ArrayBasedStackGenerator
Removes the element at the top of the given ArrayBasedStack.

Specified by:
pop in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack from which to pop the element.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

push

public void push(ArrayBasedStack<T> abs,
                 T elem,
                 Timing delay,
                 Timing duration)
Description copied from interface: ArrayBasedStackGenerator
Pushes the element elem onto the top of the given ArrayBasedStack.

Specified by:
push in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack onto the top of which to push the element.
elem - the element to be pushed onto the stack.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

top

public void top(ArrayBasedStack<T> abs,
                Timing delay,
                Timing duration)
Description copied from interface: ArrayBasedStackGenerator
Retrieves (without removing) the element at the top of the given ArrayBasedStack.

Specified by:
top in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack from which to retrieve the top element.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

isEmpty

public void isEmpty(ArrayBasedStack<T> abs,
                    Timing delay,
                    Timing duration)
Description copied from interface: ArrayBasedStackGenerator
Tests if the given ArrayBasedStack is empty.

Specified by:
isEmpty in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack which is tested.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

highlightTopCell

public void highlightTopCell(ArrayBasedStack<T> abs,
                             Timing delay,
                             Timing duration)
Description copied from interface: ArrayBasedStackGenerator
Highlights the cell which contains the top element of the given ArrayBasedStack.

Specified by:
highlightTopCell in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

highlightTopElem

public void highlightTopElem(ArrayBasedStack<T> abs,
                             Timing delay,
                             Timing duration)
Description copied from interface: ArrayBasedStackGenerator
Highlights the top element of the given ArrayBasedStack.

Specified by:
highlightTopElem in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

unhighlightTopCell

public void unhighlightTopCell(ArrayBasedStack<T> abs,
                               Timing delay,
                               Timing duration)
Description copied from interface: ArrayBasedStackGenerator
Unhighlights the cell which contains the top element of the given ArrayBasedStack.

Specified by:
unhighlightTopCell in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

unhighlightTopElem

public void unhighlightTopElem(ArrayBasedStack<T> abs,
                               Timing delay,
                               Timing duration)
Description copied from interface: ArrayBasedStackGenerator
Unhighlights the top element of the given ArrayBasedStack.

Specified by:
unhighlightTopElem in interface ArrayBasedStackGenerator<T>
Parameters:
abs - the ArrayBasedStack to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.