FileDocCategorySizeDatePackage
Reversing1.javaAPI DocExample1094Sat Sep 12 03:01:00 BST 1998None

Reversing1

public class Reversing1 extends Object
Reversing a JGL container, reversing a native array of primitives.
see
com.objectspace.jgl.algorithms.Reversing
version
3.0.0
author
ObjectSpace, Inc.

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

    Array array = new Array();
    for ( int i = 0; i < 10; i++ )
      array.add( new Integer( i ) );
    System.out.println( "array = " + array );
    Reversing.reverse( array );
    System.out.println( "after reverse = " + array );

    int ints[] = new int[ 10 ];
    for ( int i = 0; i < ints.length; i++ )
      ints[ i ] = i;
    IntArray intArray = new IntArray( ints );
    System.out.println( "primitive array = " + intArray );
    Array result = new Array();
    Reversing.reverseCopy( intArray, new InsertIterator( result ) );
    System.out.println( "Array of reversed array = " + result );