public abstract class QueueListStandard<E extends Entity> extends QueueList<E> implements java.beans.PropertyChangeListener
QueueListFifo and
QueueListLifo.QueueBased,
Queue,
ProcessQueue,
QueueListFifo,
QueueListLifo| Constructor and Description |
|---|
QueueListStandard()
Constructs an empty
QueueList with no reference to its
client QueueBased. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(E e)
Returns true if the given Entity is contained in the list, false
otherwise.
|
E |
first()
Returns the first entity stored in the list.
|
int |
get(E element)
Returns the position of the named
Entity. |
E |
get(int index)
Returns the
Entity queued at the named position. |
java.lang.String |
getAbbreviation()
Returns an abbreviation as a String to identify the sort of queueing
discipline (like FIFO or LIFO or ...).
|
abstract void |
insert(E e)
Adds a new Entity to the QueueList.
|
boolean |
isEmpty()
Returns
true, if no elements are inside the
QueueList,false otherwise |
E |
last()
Returns the last Entity stored in the QueueList.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
This method will be called every time the Stock (the number of available
units) has changed.
|
boolean |
remove(E e)
Removes the first occurrence of the given Entity from the QueueList.
|
boolean |
remove(int index)
Removes the
Entity queued at the named position. |
E |
succ(E e)
Returns the successor to the given Entity in the QueueList.
|
java.lang.String |
toString()
Returns a string representation of the QueueList.
|
iterator, setQueueBased, sizepublic QueueListStandard()
QueueList with no reference to its
client QueueBased. This no-arg constructor is necessary to instantiate an
object of this class by calling the
java.lang.Class.newInstance() method. The reference to the
QueueBased object making use of this queue-functionality must be provided
later by calling the setQueueBased() method. The initial length is always
zero.public boolean contains(E e)
public E first()
null is returned.public int get(E element)
Entity.
The first position is 0, the last one size()-1.public E get(int index)
Entity queued at the named position.
The first position is 0, the last one size()-1.public java.lang.String getAbbreviation()
getAbbreviation in class QueueList<E extends Entity>public abstract void insert(E e)
statisticalInsert() and
to set the queue for each entity as you define this method.public boolean isEmpty()
true, if no elements are inside the
QueueList,false otherwisepublic E last()
null is returned.public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerevt - java.beans.PropertyChangeEvent : The event specifying the
property that has changed ans its old and new value.public boolean remove(E e)
null
true is returned and the
Entity is removed, otherwise false is the return value
because the given Entity could not be removed since one of the
restrictions above was not met.public boolean remove(int index)
Entity queued at the named position.
The first position is 0, the last one size()-1.public E succ(E e)
null is
returned.succ in class QueueList<E extends Entity>e - Entity : The Entity contained in the QueueListnull if the given Entity
parameter 'e' has no successor in the QueueList or e itself
is not contained in the QueueListpublic java.lang.String toString()
toString() methods.