|
PircBot Java IRC Bot | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibble.pircbot.Queue
Queue is a definition of a data structure that may act as a queue - that is, data can be added to one end of the queue and data can be requested from the head end of the queue. This class is thread safe for multiple producers and a single consumer. The next() method will block until there is data in the queue. This has now been modified so that it is compatible with the earlier JDK1.1 in order to be suitable for running on mobile appliances. This means replacing the LinkedList with a Vector, which is hardly ideal, but this Queue is typically only polled every second before dispatching messages.
Constructor Summary | |
Queue()
Constructs a Queue object of unlimited size. |
Method Summary | |
void |
add(Object o)
Adds an Object to the end of the Queue. |
void |
addFront(Object o)
Adds an Object to the front of the Queue. |
void |
clear()
Clears the contents of the Queue. |
boolean |
hasNext()
Returns true if the Queue is not empty. |
Object |
next()
Returns the Object at the front of the Queue. |
int |
size()
Returns the size of the Queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Queue()
Method Detail |
public void add(Object o)
o
- The Object to be added to the Queue.public void addFront(Object o)
o
- The Object to be added to the Queue.public Object next()
public boolean hasNext()
public void clear()
public int size()
|
PircBot Java IRC Bot | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |