algoanim.animalscript
Class AnimalArrayBasedQueueGenerator<T>

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

public class AnimalArrayBasedQueueGenerator<T>
extends AnimalGenerator
implements ArrayBasedQueueGenerator<T>


Field Summary
 
Fields inherited from class algoanim.primitives.generators.Generator
lang
 
Constructor Summary
AnimalArrayBasedQueueGenerator(Language aLang)
           
 
Method Summary
 void create(ArrayBasedQueue<T> abq)
          Creates the originating script code for a given ArrayBasedQueue, 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 dequeue(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Removes the first element of the given ArrayBasedQueue.
 void enqueue(ArrayBasedQueue<T> abq, T elem, Timing delay, Timing duration)
          Adds the element elem as the last element to the end of the given ArrayBasedQueue.
 void front(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Retrieves (without removing) the first element of the given ArrayBasedQueue.
 void highlightFrontCell(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Highlights the cell which contains the first element of the given ArrayBasedQueue.
 void highlightFrontElem(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Highlights the first element of the given ArrayBasedQueue.
 void highlightTailCell(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Highlights the cell which contains the last element of the given ArrayBasedQueue.
 void highlightTailElem(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Highlights the last element of the given ArrayBasedQueue.
 void isEmpty(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Tests if the given ArrayBasedQueue is empty.
 void isFull(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Tests if the given ArrayBasedQueue is full.
 void tail(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Retrieves (without removing) the last element of the given ArrayBasedQueue.
 void unhighlightFrontCell(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Unhighlights the cell which contains the first element of the given ArrayBasedQueue.
 void unhighlightFrontElem(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Unhighlights the first element of the given ArrayBasedQueue.
 void unhighlightTailCell(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Unhighlights the cell which contains the last element of the given ArrayBasedQueue.
 void unhighlightTailElem(ArrayBasedQueue<T> abq, Timing delay, Timing duration)
          Unhighlights the last element of the given ArrayBasedQueue.
 
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

AnimalArrayBasedQueueGenerator

public AnimalArrayBasedQueueGenerator(Language aLang)
Method Detail

create

public void create(ArrayBasedQueue<T> abq)
Description copied from interface: ArrayBasedQueueGenerator
Creates the originating script code for a given ArrayBasedQueue, 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 ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue for which the initiate script code shall be created.

dequeue

public void dequeue(ArrayBasedQueue<T> abq,
                    Timing delay,
                    Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Removes the first element of the given ArrayBasedQueue.

Specified by:
dequeue in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue from which to remove the first element.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

enqueue

public void enqueue(ArrayBasedQueue<T> abq,
                    T elem,
                    Timing delay,
                    Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Adds the element elem as the last element to the end of the given ArrayBasedQueue.

Specified by:
enqueue in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue to the end of which to add the element.
elem - the element to be added to the end of the queue.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

front

public void front(ArrayBasedQueue<T> abq,
                  Timing delay,
                  Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Retrieves (without removing) the first element of the given ArrayBasedQueue.

Specified by:
front in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue from which to retrieve the first element.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

highlightFrontCell

public void highlightFrontCell(ArrayBasedQueue<T> abq,
                               Timing delay,
                               Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Highlights the cell which contains the first element of the given ArrayBasedQueue.

Specified by:
highlightFrontCell in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

highlightFrontElem

public void highlightFrontElem(ArrayBasedQueue<T> abq,
                               Timing delay,
                               Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Highlights the first element of the given ArrayBasedQueue.

Specified by:
highlightFrontElem in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

highlightTailCell

public void highlightTailCell(ArrayBasedQueue<T> abq,
                              Timing delay,
                              Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Highlights the cell which contains the last element of the given ArrayBasedQueue.

Specified by:
highlightTailCell in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

highlightTailElem

public void highlightTailElem(ArrayBasedQueue<T> abq,
                              Timing delay,
                              Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Highlights the last element of the given ArrayBasedQueue.

Specified by:
highlightTailElem in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

isEmpty

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

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

isFull

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

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

tail

public void tail(ArrayBasedQueue<T> abq,
                 Timing delay,
                 Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Retrieves (without removing) the last element of the given ArrayBasedQueue.

Specified by:
tail in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue from which to retrieve the last element.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

unhighlightFrontCell

public void unhighlightFrontCell(ArrayBasedQueue<T> abq,
                                 Timing delay,
                                 Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Unhighlights the cell which contains the first element of the given ArrayBasedQueue.

Specified by:
unhighlightFrontCell in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

unhighlightFrontElem

public void unhighlightFrontElem(ArrayBasedQueue<T> abq,
                                 Timing delay,
                                 Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Unhighlights the first element of the given ArrayBasedQueue.

Specified by:
unhighlightFrontElem in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

unhighlightTailCell

public void unhighlightTailCell(ArrayBasedQueue<T> abq,
                                Timing delay,
                                Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Unhighlights the cell which contains the last element of the given ArrayBasedQueue.

Specified by:
unhighlightTailCell in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.

unhighlightTailElem

public void unhighlightTailElem(ArrayBasedQueue<T> abq,
                                Timing delay,
                                Timing duration)
Description copied from interface: ArrayBasedQueueGenerator
Unhighlights the last element of the given ArrayBasedQueue.

Specified by:
unhighlightTailElem in interface ArrayBasedQueueGenerator<T>
Parameters:
abq - the ArrayBasedQueue to work on.
delay - [optional] the time to wait until the operation shall be performed.
duration - [optional] the duration of the operation.