home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
inprise
/
JSAMPLES.Z
/
Functions8.java
< prev
next >
Wrap
Text File
|
1998-05-08
|
616b
|
20 lines
// Copyright(c) 1997 ObjectSpace, Inc.
import com.objectspace.jgl.*;
import com.objectspace.jgl.adapters.*;
import com.objectspace.jgl.algorithms.*;
import com.objectspace.jgl.predicates.*;
public class Functions8
{
public static void main( String[] args )
{
double array[] = { 3, 1, 5, -2, 7, 9 };
DoubleArray doubleArray = new DoubleArray( array );
BinaryPredicate comparator = new LessNumber( Double.class );
System.out.println( "unsorted = " + doubleArray );
Sorting.sort( doubleArray, comparator );
System.out.println( "sorted = " + doubleArray );
}
}