All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.Queue
java.lang.Object
|
+----COM.objectspace.jgl.Queue
- public class Queue
- extends Object
- implements Container
A Queue is an adapter that allows you to use any Sequence as a
first-in, first-out data structure. By default, a Queue uses an
SList.
- See Also:
- Sequence, SList, QueueExamples
-
Queue()
- Construct myself to be an empty Queue.
-
Queue(Queue)
- Construct myself to be a shallow copy of a specified Queue.
-
Queue(Sequence)
- Construct myself with a specified Sequence as my underlying implementation.
-
add(Object)
- Add an object to my back.
-
back()
- Return the object at my back.
-
clear()
- Remove all of my objects.
-
clone()
- Return a shallow copy of myself.
-
copy(Queue)
- Become a shallow copy of a Queue.
-
elements()
- Return an Enumeration of my components.
-
equals(Object)
- Return true if object is a Queue whose underlying sequence is equal to mine.
-
equals(Queue)
- Return true if a Queue's sequence is equal to mine.
-
finish()
- Return an iterator positioned immediately afer my last item.
-
front()
- Return the object at my front.
-
hashCode()
- Return my hash code for support of hashing containers
-
isEmpty()
- Return true if I contain no objects.
-
maxSize()
- Return the maximum number of objects that I can contain.
-
pop()
- Remove an object from my front and return it.
-
push(Object)
- Add an object to my back.
-
remove(Enumeration)
- Remove the element at a particular position.
-
remove(Enumeration, Enumeration)
- Remove the elements in the specified range.
-
size()
- Return the number of objects that I contain.
-
start()
- Return an iterator positioned at my first item.
-
swap(Queue)
- Swap my contents with another Queue.
-
toString()
- Return a string that describes me.
Queue
public Queue()
- Construct myself to be an empty Queue.
Use an SList for my underlying implementation.
Queue
public Queue(Sequence sequence)
- Construct myself with a specified Sequence as my underlying implementation.
- Parameters:
- sequence - The empty Sequence to be used for my implementation.
Queue
public Queue(Queue queue)
- Construct myself to be a shallow copy of a specified Queue.
- Parameters:
- queue - The Queue to be copied.
copy
public synchronized void copy(Queue queue)
- Become a shallow copy of a Queue.
- Parameters:
- queue - The Queue to be copied.
toString
public synchronized String toString()
- Return a string that describes me.
- Overrides:
- toString in class Object
equals
public boolean equals(Object object)
- Return true if object is a Queue whose underlying sequence is equal to mine.
- Parameters:
- object - Any object.
- Overrides:
- equals in class Object
equals
public synchronized boolean equals(Queue queue)
- Return true if a Queue's sequence is equal to mine.
- Parameters:
- queue - The Queue to compare myself against.
hashCode
public synchronized int hashCode()
- Return my hash code for support of hashing containers
- Overrides:
- hashCode in class Object
clone
public synchronized Object clone()
- Return a shallow copy of myself.
A shallow copy is made of my underlying sequence.
- Overrides:
- clone in class Object
clear
public synchronized void clear()
- Remove all of my objects.
isEmpty
public boolean isEmpty()
- Return true if I contain no objects.
size
public int size()
- Return the number of objects that I contain.
maxSize
public int maxSize()
- Return the maximum number of objects that I can contain.
front
public synchronized Object front()
- Return the object at my front.
- Throws: InvalidOperationException
- If the Queue is empty.
back
public synchronized Object back()
- Return the object at my back.
- Throws: InvalidOperationException
- If the Queue is empty.
add
public synchronized Object add(Object object)
- Add an object to my back.
- Parameters:
- object - The object to add.
push
public void push(Object object)
- Add an object to my back.
pop
public synchronized Object pop()
- Remove an object from my front and return it.
- Throws: InvalidOperationException
- If the Queue is empty.
elements
public synchronized Enumeration elements()
- Return an Enumeration of my components.
start
public synchronized ForwardIterator start()
- Return an iterator positioned at my first item.
finish
public synchronized ForwardIterator finish()
- Return an iterator positioned immediately afer my last item.
swap
public synchronized void swap(Queue queue)
- Swap my contents with another Queue.
- Parameters:
- queue - The Queue that I will swap my contents with.
remove
public Object remove(Enumeration pos)
- Remove the element at a particular position.
- Parameters:
- pos - The enumeration representing of the object to remove.
- Throws: InvalidOperationException
- Thrown by default.
remove
public int remove(Enumeration first,
Enumeration last)
- Remove the elements in the specified range.
- Parameters:
- pos - The enumeration representing of the object to remove.
- Throws: InvalidOperationException
- Thrown by default.
All Packages Class Hierarchy This Package Previous Next Index