home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / examples / functions6.java < prev    next >
Encoding:
Java Source  |  1996-08-28  |  471 b   |  16 lines

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. import jgl.*;
  3.  
  4. public class Functions6
  5.   {
  6.   public static void main( String[] args )
  7.     {
  8.     DList list = new DList();
  9.     list.add( "dog" );
  10.     list.add( "ape" );
  11.     list.add( "emu" );  
  12.     UnaryPredicate predicate = new BindSecondPredicate( new GreaterString(), "bat" );
  13.     int n = Counting.countIf( list, predicate );
  14.     System.out.println( "The number of strings in " + list + " > bat = " + n );
  15.     }
  16.   }