home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 October A / Pcwk10a98.iso / Inprise / TRIAL / JBUILDER / JSAMPLES.Z / Functions4.java < prev    next >
Text File  |  1998-05-08  |  603b  |  19 lines

  1. // Copyright(c) 1996,1997 ObjectSpace, Inc.
  2. import com.objectspace.jgl.*;
  3. import com.objectspace.jgl.adapters.*;
  4. import com.objectspace.jgl.algorithms.*;
  5. import com.objectspace.jgl.predicates.*;
  6.  
  7. public class Functions4
  8.   {
  9.   public static void main( String[] args )
  10.     {
  11.     long array[] = { 3, 1, 5, -2, 7, 9 };
  12.     LongArray longArray = new LongArray( array );
  13.     BinaryPredicate comparator = new LessNumber( Long.class );
  14.     System.out.println( "unsorted = " + longArray );
  15.     Sorting.sort( longArray, comparator );
  16.     System.out.println( "sorted = " + longArray );
  17.     }
  18.   }
  19.