algoanim.animalscript
Class AnimalConceptualStackGenerator<T>

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

public class AnimalConceptualStackGenerator<T>
extends AnimalGenerator
implements ConceptualStackGenerator<T>

Author:
Dima Vronskyi
See Also:
ConceptualStackGenerator

Field Summary
 
Fields inherited from class algoanim.primitives.generators.Generator
lang
 
Constructor Summary
AnimalConceptualStackGenerator(Language aLang)
           
 
Method Summary
 void create(ConceptualStack<T> cs)
          Creates the originating script code for a given ConceptualStack, 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(ConceptualStack<T> cs, Timing delay, Timing duration)
          Highlights the cell which contains the top element of the given ConceptualStack.
 void highlightTopElem(ConceptualStack<T> cs, Timing delay, Timing duration)
          Highlights the top element of the given ConceptualStack.
 void isEmpty(ConceptualStack<T> cs, Timing delay, Timing duration)
          Tests if the given ConceptualStack is empty.
 void pop(ConceptualStack<T> cs, Timing delay, Timing duration)
          Removes the element at the top of the given ConceptualStack.
 void push(ConceptualStack<T> cs, T elem, Timing delay, Timing duration)
          Pushes the element elem onto the top of the given ConceptualStack.
 void top(ConceptualStack<T> cs, Timing delay, Timing duration)
          Retrieves (without removing) the element at the top of the given ConceptualStack.
 void unhighlightTopCell(ConceptualStack<T> cs, Timing delay, Timing duration)
          Unhighlights the cell which contains the top element of the given ConceptualStack.
 void unhighlightTopElem(ConceptualStack<T> cs, Timing delay, Timing duration)
          Unhighlights the top element of the given ConceptualStack.
 
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

AnimalConceptualStackGenerator

public AnimalConceptualStackGenerator(Language aLang)
Parameters:
aLang - the associated Language object.
Method Detail

create

public void create(ConceptualStack<T> cs)
Description copied from interface: ConceptualStackGenerator
Creates the originating script code for a given ConceptualStack, 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 ConceptualStackGenerator<T>
Parameters:
cs - the ConceptualStack for which the initiate script code shall be created.
See Also:
#create(algoanim.primitives.ConceptualStack)

pop

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

Specified by:
pop in interface ConceptualStackGenerator<T>
Parameters:
cs - the ConceptualStack 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(ConceptualStack<T> cs,
                 T elem,
                 Timing delay,
                 Timing duration)
Description copied from interface: ConceptualStackGenerator
Pushes the element elem onto the top of the given ConceptualStack.

Specified by:
push in interface ConceptualStackGenerator<T>
Parameters:
cs - the ConceptualStack 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(ConceptualStack<T> cs,
                Timing delay,
                Timing duration)
Description copied from interface: ConceptualStackGenerator
Retrieves (without removing) the element at the top of the given ConceptualStack.

Specified by:
top in interface ConceptualStackGenerator<T>
Parameters:
cs - the ConceptualStack 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(ConceptualStack<T> cs,
                    Timing delay,
                    Timing duration)
Description copied from interface: ConceptualStackGenerator
Tests if the given ConceptualStack is empty.

Specified by:
isEmpty in interface ConceptualStackGenerator<T>
Parameters:
cs - the ConceptualStack 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(ConceptualStack<T> cs,
                             Timing delay,
                             Timing duration)
Description copied from interface: ConceptualStackGenerator
Highlights the cell which contains the top element of the given ConceptualStack.

Specified by:
highlightTopCell in interface ConceptualStackGenerator<T>
Parameters:
cs - the ConceptualStack 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(ConceptualStack<T> cs,
                             Timing delay,
                             Timing duration)
Description copied from interface: ConceptualStackGenerator
Highlights the top element of the given ConceptualStack.

Specified by:
highlightTopElem in interface ConceptualStackGenerator<T>
Parameters:
cs - the ConceptualStack 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(ConceptualStack<T> cs,
                               Timing delay,
                               Timing duration)
Description copied from interface: ConceptualStackGenerator
Unhighlights the cell which contains the top element of the given ConceptualStack.

Specified by:
unhighlightTopCell in interface ConceptualStackGenerator<T>
Parameters:
cs - the ConceptualStack 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(ConceptualStack<T> cs,
                               Timing delay,
                               Timing duration)
Description copied from interface: ConceptualStackGenerator
Unhighlights the top element of the given ConceptualStack.

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