samples/growingparameters/src-api1.0/api/classes/Support.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:53:37 +0200
changeset 77 22c1953e372c
child 78 af48bccb02cb
permissions -rw-r--r--
Compute with added method converted to separate project
     1 /*
     2  * To change this template, choose Tools | Templates
     3  * and open the template in the editor.
     4  */
     5 
     6 package api.classes;
     7 
     8 import java.util.Iterator;
     9 import java.util.List;
    10 
    11 /**
    12  *
    13  * @author Jaroslav Tulach <jaroslav.tulach@netbeans.org>
    14  */
    15 public class Support {
    16     private Support() {
    17     }
    18     
    19     public static int searchByName(String name, Compute provider) {
    20         Iterator<String> it = provider.getData().iterator();
    21         for (int i = 0; it.hasNext(); i++) {
    22             if (name.equals(it.next())) {
    23                 return i;
    24             }
    25         }
    26         return -1;
    27     }
    28     
    29 }