samples/growingparameters/src-api1.0/api/classes/Support.java
changeset 77 22c1953e372c
child 78 af48bccb02cb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/samples/growingparameters/src-api1.0/api/classes/Support.java	Sat Jun 14 09:53:37 2008 +0200
     1.3 @@ -0,0 +1,29 @@
     1.4 +/*
     1.5 + * To change this template, choose Tools | Templates
     1.6 + * and open the template in the editor.
     1.7 + */
     1.8 +
     1.9 +package api.classes;
    1.10 +
    1.11 +import java.util.Iterator;
    1.12 +import java.util.List;
    1.13 +
    1.14 +/**
    1.15 + *
    1.16 + * @author Jaroslav Tulach <jaroslav.tulach@netbeans.org>
    1.17 + */
    1.18 +public class Support {
    1.19 +    private Support() {
    1.20 +    }
    1.21 +    
    1.22 +    public static int searchByName(String name, Compute provider) {
    1.23 +        Iterator<String> it = provider.getData().iterator();
    1.24 +        for (int i = 0; it.hasNext(); i++) {
    1.25 +            if (name.equals(it.next())) {
    1.26 +                return i;
    1.27 +            }
    1.28 +        }
    1.29 +        return -1;
    1.30 +    }
    1.31 +    
    1.32 +}