JML

org.multijava.util
Class ArrayLocator

java.lang.Object
  extended byorg.multijava.util.ArrayLocator

public class ArrayLocator
extends Object

This class allows to find the position of an object in an array.


Field Summary
private  Object[] array
           
private  Hashtable hashed
           
private static int MIN_HASH
           
 
Constructor Summary
ArrayLocator(Object[] array)
          Constructs a new ArrayLocator object.
 
Method Summary
 int getIndex(Object object)
          Returns the index of the specified object in the array, or -1 if the object cannot be found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_HASH

private static final int MIN_HASH

array

private Object[] array

hashed

private Hashtable hashed
Constructor Detail

ArrayLocator

public ArrayLocator(Object[] array)
Constructs a new ArrayLocator object.

Method Detail

getIndex

public int getIndex(Object object)
Returns the index of the specified object in the array, or -1 if the object cannot be found. TEST: linear search. !!!


JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.