Package weka.core

Class Queue

    • Constructor Detail

      • Queue

        public Queue()
    • Method Detail

      • removeAllElements

        public final void removeAllElements()
        Removes all objects from the queue m_Tail.m_Next.
      • push

        public Object push​(Object item)
        Appends an object to the back of the queue.
        Parameters:
        item - the object to be appended
        Returns:
        the object appended
      • pop

        public Object pop()
                   throws RuntimeException
        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
      • 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

        public String toString()
        Produces textual description of queue.
        Overrides:
        toString in class Object
        Returns:
        textual description of queue
      • main

        public static void main​(String[] argv)
        Main method for testing this class.
        Parameters:
        argv - a set of strings that are pushed on a test queue