KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4odoc > f1 > diagnostics > ArbitraryQuery


1 package com.db4odoc.f1.diagnostics;
2
3 import com.db4o.query.Predicate;
4
5 public class ArbitraryQuery extends Predicate<Pilot>{
6     public int[] points;
7     
8     public ArbitraryQuery(int[] points) {
9         this.points=points;
10     }
11     
12     public boolean match(Pilot pilot) {
13         for (int i = 0; i < points.length; i++) {
14             if (((Pilot)pilot).getPoints() == points[i])
15             {
16                 return true;
17             }
18         }
19         return ((Pilot)pilot).getName().startsWith("Rubens");
20     }
21
22     
23 }
24
Popular Tags