Zahan's answer is right. However, the complexity of looking up an element in an ArrayList is O(n).
However, seeing the description, I think what you are looking for is a Map.
What a Map does, is stores information corresponding to a particular key. For example, I can have the Employee ID numbers as the key and the corresponding name of that employee as the value. You can read more about the tutorial I have written here or the generic one here.
I must mention that Map in JAVA is an Interface, so to implement it, you can use the HashMap class (uses hashing) which offers Amortized O(1) lookup time which is what you want to be shooting for.
Here is the implementation for storing the Employee id numbers as the key and the employoee names as the value. I must also mention that keys in a Map must always be unique. You will learn all this in the tutorial. I will assume that you have the Employee names and id numbers stored in an array of objects of class 'employee'. Here goes:
employee[] data=new employee[100];
/*code in this to store in this whatever data you have to
*/
Map<Integer, String> lookupEmpName=new HashMap<Integer, String>();
for(int i=0;i<data.length;i++)
lookupEmpName.put(data[i].getEmpNumber,data[i].getName); //Store the key as the number and the name as the value
String name=lookupEmpName.get(1234); //name will store the corresponding name of the employee if it exists or stores null
I hope this is what you were looking for. I'd be gald to help you out