algoanim.animalscript
Class AnimalConceptualQueueGenerator<T>

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

public class AnimalConceptualQueueGenerator<T>
extends AnimalGenerator
implements ConceptualQueueGenerator<T>

Author:
Dima Vronskyi
See Also:
ConceptualQueueGenerator

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

AnimalConceptualQueueGenerator

public AnimalConceptualQueueGenerator(Language aLang)
Method Detail

create

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

dequeue

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

Specified by:
dequeue in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                    T elem,
                    Timing delay,
                    Timing duration)
Description copied from interface: ConceptualQueueGenerator
Adds the element elem as the last element to the end of the given ConceptualQueue.

Specified by:
enqueue in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                  Timing delay,
                  Timing duration)
Description copied from interface: ConceptualQueueGenerator
Retrieves (without removing) the first element of the given ConceptualQueue.

Specified by:
front in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                               Timing delay,
                               Timing duration)
Description copied from interface: ConceptualQueueGenerator
Highlights the cell which contains the first element of the given ConceptualQueue.

Specified by:
highlightFrontCell in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                               Timing delay,
                               Timing duration)
Description copied from interface: ConceptualQueueGenerator
Highlights the first element of the given ConceptualQueue.

Specified by:
highlightFrontElem in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                              Timing delay,
                              Timing duration)
Description copied from interface: ConceptualQueueGenerator
Highlights the cell which contains the last element of the given ConceptualQueue.

Specified by:
highlightTailCell in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                              Timing delay,
                              Timing duration)
Description copied from interface: ConceptualQueueGenerator
Highlights the last element of the given ConceptualQueue.

Specified by:
highlightTailElem in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                    Timing delay,
                    Timing duration)
Description copied from interface: ConceptualQueueGenerator
Tests if the given ConceptualQueue is empty.

Specified by:
isEmpty in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                 Timing delay,
                 Timing duration)
Description copied from interface: ConceptualQueueGenerator
Retrieves (without removing) the last element of the given ConceptualQueue.

Specified by:
tail in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                                 Timing delay,
                                 Timing duration)
Description copied from interface: ConceptualQueueGenerator
Unhighlights the cell which contains the first element of the given ConceptualQueue.

Specified by:
unhighlightFrontCell in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                                 Timing delay,
                                 Timing duration)
Description copied from interface: ConceptualQueueGenerator
Unhighlights the first element of the given ConceptualQueue.

Specified by:
unhighlightFrontElem in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                                Timing delay,
                                Timing duration)
Description copied from interface: ConceptualQueueGenerator
Unhighlights the cell which contains the last element of the given ConceptualQueue.

Specified by:
unhighlightTailCell in interface ConceptualQueueGenerator<T>
Parameters:
cq - the ConceptualQueue 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(ConceptualQueue<T> cq,
                                Timing delay,
                                Timing duration)
Description copied from interface: ConceptualQueueGenerator
Unhighlights the last element of the given ConceptualQueue.

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