FileDocCategorySizeDatePackage
Deque2.javaAPI DocExample1220Sat Sep 12 03:01:00 BST 1998None

Deque2

public class Deque2 extends Object
Counting, finding, erasing, replacing, removing.
see
com.objectspace.jgl,Deque
version
3.0.0
author
ObjectSpace, Inc.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    Deque deque = new Deque();
    deque.add( "ape" );
    deque.add( "bat" );
    deque.add( "cat" );
    deque.add( "bat" );
    deque.add( "bat" );
    deque.add( "cat" );
    System.out.println( deque );
    System.out.println();

    System.out.println( "deque.count( bat ) = " + deque.count( "bat" ) );
    int index = deque.indexOf( "bat" );
    System.out.println( "deque.indexOf( bat ) = " + index );
    deque.remove( index );
    System.out.println( "After deque.remove( " + index + " ) = " + deque );
    deque.replace( 0, 2, "bat", "BAT" );
    System.out.println( "After deque.replace( 0, 2, bat, BAT ) = " + deque );
    System.out.println( "deque.remove( cat ) = " + deque.remove( "cat" ) );
    System.out.println( "After deque.remove( cat ) = " + deque );
    deque.remove( deque.begin() );
    System.out.println( "After deque.remove( begin() ) = " + deque );