Code example for Vector

Methods: elementAtremoveElementAt

0
    public void push( Node n ) {
        queue.addElement(n);
    } 
     
    public Node pop() {
        Node n = (Node)queue.elementAt(0);
        queue.removeElementAt(0);
        return n;
    } 
     
    public boolean isEmpty() { 
        return queue.size() == 0;
    } 
     
    public boolean contains( Node n ) {
        return queue.contains(n);
    } 
 
} // end com.touchgraph.graphlayout.graphelements.TGNodeQueue 
Experience pair programming with AI  Get Codota for Java