home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 October A / Pcwk10a98.iso / Inprise / TRIAL / JBUILDER / JSAMPLES.Z / Functions2.java < prev    next >
Text File  |  1998-05-08  |  579b  |  18 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 Functions2
  8.   {
  9.   public static void main( String[] args )
  10.     {
  11.     boolean array[] = { false, false, true, false, true };
  12.     BooleanArray bools = new BooleanArray( array );
  13.     UnaryPredicate predicate = new LogicalNot();
  14.     int n = Counting.countIf( bools, predicate );
  15.     System.out.println( "Number of false in " + bools + " = " + n );
  16.     }
  17.   }
  18.