FileDocCategorySizeDatePackage
Algorithms1.javaAPI DocExample1103Sat Sep 12 03:01:00 BST 1998None

Algorithms1

public class Algorithms1 extends Object
Applying provides algorithms for affecting every element in a container.
see
com.objectspace.jgl.algorithms.Applying
version
3.0.0
author
ObjectSpace, Inc.

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

    Array array1 = new Array();
    array1.add( "cat" );
    array1.add( "monkey" );
    array1.add( "goat" );
    Applying.forEach( array1, new PrintFunction() );

    SList list = new SList();
    list.add( new Integer( 3 ) );
    list.add( new Integer( 7 ) );
    list.add( new Integer( 4 ) );
    Integer total = (Integer)Applying.inject( list, new Integer( 0 ), new PlusNumber() );
    System.out.println( "list = " + list + ", total = " + total );