Package weka.core
Class Queue
java.lang.Object
weka.core.Queue
- All Implemented Interfaces:
Serializable
,RevisionHandler
Class representing a FIFO queue.
- Version:
- $Revision: 8034 $
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
empty()
Checks if queue is empty.Returns the revision string.static void
Main method for testing this class.peek()
Gets object from the front of the queue.pop()
Pops an object from the front of the queue.Appends an object to the back of the queue.final void
Removes all objects from the queue m_Tail.m_Next.int
size()
Gets queue's size.toString()
Produces textual description of queue.
-
Constructor Details
-
Queue
public Queue()
-
-
Method Details
-
removeAllElements
public final void removeAllElements()Removes all objects from the queue m_Tail.m_Next. -
push
Appends an object to the back of the queue.- Parameters:
item
- the object to be appended- Returns:
- the object appended
-
pop
Pops an object from the front of the queue.- Returns:
- the object at the front of the queue
- Throws:
RuntimeException
- if the queue is empty
-
peek
Gets object from the front of the queue.- Returns:
- the object at the front of the queue
- Throws:
RuntimeException
- if the queue is empty
-
empty
public boolean empty()Checks if queue is empty.- Returns:
- true if queue is empty
-
size
public int size()Gets queue's size.- Returns:
- size of queue
-
toString
Produces textual description of queue. -
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-
main
Main method for testing this class.- Parameters:
argv
- a set of strings that are pushed on a test queue
-