FileDocCategorySizeDatePackage
Algorithms4.javaAPI DocExample890Sat Sep 12 03:01:00 BST 1998None

Algorithms4

public class Algorithms4 extends Object
Finding provides algorithms for locating elements in a container.
see
com.objectspace.jgl.algorithms.Finding
version
3.0.0
author
ObjectSpace, Inc.

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

    int ints[] = { 3, 7, 8, 2, -5, 8, 9, -2 };
    IntArray array = new IntArray( ints );
    System.out.println( "array = " + array );

    Integer negative = (Integer)Finding.detect( array, new NegativeNumber() );
    System.out.println( "first negative = " + negative );

    boolean some = Finding.some( array, new NegativeNumber() );
    System.out.println( "some items are negative = " + some );