Gets the index of the first element in this vector with the specified
value, or -1 if it is not present.

@param value The value to search for.
@param delta The delta with which to evaluate equality.
@return The index or -1 if not present.
546371
public int lookupIndex(float value, float delta) {
        for (int i=0; i<elements.length; i++) {
            if (Primitives.equals(elements[i], value, delta)) {
                return i;
            }
        }
        return -1;
    }
1087140
private int findValue(String s) {

        for (int i = 0; i < values.size(); i++) {
            if (s.equals(values.elementAt(i))) {
                return i;
            }    // end of if (s.equals(values.elementAt(i)))
        }        // end of for (int i=0; i<values.size(); i++)

        return -1;
    }
1013396
public static Float getQuality(String value)
    {
        if (value==null)
            return __zero;
        
        int qe=value.indexOf(";");
        if (qe++<0 || qe==value.length())
            return __one;
        
        if (value.charAt(qe++)=='q')
        {
            qe++;
            Map.Entry entry=__qualities.getEntry(value,qe,value.length()-qe);
            if (entry!=null)
                return (Float)entry.getValue();
        }
        
        HashMap params = new HashMap(3);
        valueParameters(value,params);
        String qs=(String)params.get("q");
        Float q=(Float)__qualities.get(qs);
        if (q==null)
        {
            try{q=new Float(qs);}
            catch(Exception e){q=__one;}
        }
        return q;
    }
197126
public @DoNotSub int indexOf(
        final int value)
    {
        for (@DoNotSub int i = 0; i < size; i++)
        {
            if (value == elements[i])
            {
                return i;
            }
        }

        return -1;
    }
1275542
public int getIndexOfValue(String fieldName, Object value) {
		int ret = -1;
		Object val = value;
		if (value instanceof DomainObject)
			val = ((DomainObject)value).getRawObject();
		Object lst = getFieldValue(fieldName, true); // internal
		if (lst instanceof List<?>) {
			List<?> list = (List<?>)lst;
			for (int i = 0; i < list.size(); i++) {
				Object obj = list.get(i);
				if (obj.equals(val)) {
					ret = i;
					break;
				}
			}
		} else if (lst != null && lst.getClass().isArray()) {
			int len = Array.getLength(lst);
			for (int i = 0; i < len; i++) {
				Object obj = Array.get(lst, i);
				if (obj.equals(val)) {
					ret = i;
					break;
				}
			}
		} else {
			if (!getDomainObjectType().getFieldByName(fieldName).isListOrArray())
				throw new RuntimeException("field: [" + fieldName + "] is neither list nor array");
			if (lst == null)
				throw new RuntimeException("list or array field: [" + fieldName + "] is null");
		}
		return ret;
	}
781241
public static int indexOf (int[] list, int value)
    {
        int llength = list.length; // no optimizing bastards
        for (int i = 0; i < llength; i++) {
            if (list[i] == value) {
                return i;
            }
        }
        return -1;
    }
439592
private boolean isPid(String value) {
        if ( (value == null)
                || (value.indexOf("+") != -1)
                || (value.indexOf("/") != -1)
                || (value.indexOf(" ") != -1) ) {
            return false;
        }
        int i = value.indexOf(":");
        return i > 0 && i < (value.length() - 1) && value.lastIndexOf(":") == i;
    }
243317
public BigInteger addAndGet(BigInteger delta) {
        for (;;) {
        	BigInteger current = valueHolder.get();
        	BigInteger next = current.add(delta);
            if (valueHolder.compareAndSet(current, next))
                return next;
        }
    }
520662
public int getIndex (String outcome) {
        for (int i=0; i<ocNames.length; i++) {
            if (ocNames[i].equals(outcome))
                return i;
        }
        return -1;
    }
973483
public static int compare(float a, float b, float delta) {
        if (equals(a, b, delta)) {
            return 0;
        }
        return Float.compare(a, b);
    }
50152
public static int search(float[] floatArray, float value) { 
        int start = 0;
        int end = floatArray.length - 1;
        int middle = 0;
        
        while(start <= end) {
            middle = (start + end) >> 1;
        
            if(value == floatArray[middle]) {
                return middle;
            }
            
            if(value < floatArray[middle]) {
                end = middle - 1 ;
            }
            else {
                start = middle + 1;
            }
        }
                

        return -1;
    }
1122736
public int lookupIndex(short value) {
        for (int i=0; i<elements.length; i++) {
            if (elements[i] == value) {
                return i;
            }
        }
        return -1;
    }
736120
public int indexOf( byte value ) {
		for (int i = 0; i < size; i++) {
			if( data[i] == value )
				return i;
		}
		return -1;
	}
512762
public int first() {
        int val;
        int i;

        for (i = 0; i < data.length; i++) {
            if (data[i] != 0) {
                val = data[i];
                i <<= SHIFT;
                while ((val & 1) == 0) {
                    val >>>= 1;
                    i++;
                }
                return i;
            }
        }
        return -1;
    }
921318
public static int searchDescending(float[] floatArray, float value) { 
        int start = 0;
        int end = floatArray.length - 1;
        int middle = 0;
        
        while(start <= end) {
            middle = (start + end) >> 1;
        
            if(value == floatArray[middle]) {
                return middle;
            }
            
            if(value > floatArray[middle]) {
                end = middle - 1 ;
            }
            else {
                start = middle + 1;
            }
        }
                

        return -1;
    }
576544
public int getNodeIndex(final Node node) {
        for (int i = 0; i < nodeList.size(); i++) {
            if (nodeList.get(i).equals(node)) {
                return i;
            }
        }
        return -1;
    }
870761
public void fconst(float value) throws IOException
    {
        if (value == 0 || value == 1 || value == 2)
        {
            super.fconst((int) value);
        }
        else
        {
            ldc(value);
        }
    }