home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
inprise
/
JSAMPLES.Z
/
Overview8.java
< prev
next >
Wrap
Text File
|
1998-05-08
|
621b
|
20 lines
// Copyright(c) 1996,1997 ObjectSpace, Inc.
import com.objectspace.jgl.*;
import com.objectspace.jgl.algorithms.*;
import com.objectspace.jgl.predicates.*;
public class Overview8
{
public static void main( String[] args )
{
Array array = new Array();
array.add( new Integer( 3 ) );
array.add( new Integer( -1 ) );
array.add( new Integer( 2 ) );
System.out.println( "Unsorted Array = " + array );
BinaryPredicate predicate = new GreaterNumber();
Sorting.sort( array, predicate ); // Sort in descending order.
System.out.println( "Sorted = " + array );
}
}