|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgoanim.primitives.Primitive
algoanim.primitives.VisualQueue<T>
public abstract class VisualQueue<T>
Base abstract class for all the (FIFO-)queues in animalscriptapi.primitives.
VisualQueue represents the common visual features of all the subclasses
and manges the actual data using an internal java.util.LinkedList.
The stored objects are of the generic data type T, so it is generally possible
to use VisualQueue with any objects.
ConceptualQueue,
ArrayBasedQueue,
ListBasedQueue| Field Summary |
|---|
| Fields inherited from class algoanim.primitives.Primitive |
|---|
gen |
| Constructor Summary | |
|---|---|
VisualQueue(GeneratorInterface g,
Node upperLeftCorner,
java.util.List<T> content,
java.lang.String name,
DisplayOptions display,
QueueProperties qp)
Constructor of the VisualQueue. |
|
| Method Summary | |
|---|---|
T |
dequeue()
Removes and returns the first element of the queue. |
void |
enqueue(T elem)
Adds the element elem as the last element to the end of the queue. |
T |
front()
Retrieves (without removing) the first element of the queue. |
java.util.List<T> |
getInitContent()
Returns the initial content of the queue. |
QueueProperties |
getProperties()
Returns the properties of the queue. |
java.util.LinkedList<T> |
getQueue()
Returns the internal queue as java.util.LinkedList. |
Node |
getUpperLeft()
Returns the upper left corner of the queue. |
boolean |
isEmpty()
Tests if the queue is empty. |
void |
setName(java.lang.String newName)
Sets the name of this Primitive. |
T |
tail()
Retrieves (without removing) the last element of the queue. |
| 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 |
|---|
public VisualQueue(GeneratorInterface g,
Node upperLeftCorner,
java.util.List<T> content,
java.lang.String name,
DisplayOptions display,
QueueProperties qp)
VisualQueue.
g - the appropriate code Generator.upperLeftCorner - the upper left corner of this VisualQueue.content - the initial content of the VisualQueue, consisting
of the elements of the generic type T.name - the name of this VisualQueue.display - [optional] the DisplayOptions of this VisualQueue.qp - [optional] the properties of this VisualQueue.| Method Detail |
|---|
public void enqueue(T elem)
elem as the last element to the end of the queue.
elem - the element to be added to the end of the queue.LinkedList.offer(Object)public T dequeue()
LinkedList.poll()public T front()
LinkedList.peek()public T tail()
LinkedList.getLast()public boolean isEmpty()
true if and only if the queue contains no elements;
false otherwise.AbstractCollection.isEmpty()public Node getUpperLeft()
public void setName(java.lang.String newName)
PrimitivePrimitive.
setName in class PrimitivenewName - the new name for this Primitive.Primitive.setName(java.lang.String)public java.util.List<T> getInitContent()
public QueueProperties getProperties()
public java.util.LinkedList<T> getQueue()
java.util.LinkedList.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||