FileDocCategorySizeDatePackage
Array2.javaAPI DocExample1211Sat Sep 12 03:01:00 BST 1998None

Array2

public class Array2 extends Object
Counting, finding, replacing, removing.
see
com.objectspace.jgl.Array
version
3.0.0
author
ObjectSpace, Inc.

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

    Array array = new Array();
    array.add( "ape" );
    array.add( "bat" );
    array.add( "cat" );
    array.add( "bat" );
    array.add( "bat" );
    array.add( "cat" );
    System.out.println( array );
    System.out.println();

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