identityIndexOf
public int identityIndexOf(Object obj)
This method is reason why ArrayList is not used.
Search an item in list and returns its index.
It uses identity rather than 'equalsTo'
One could argue that TreeMap should be used instead,
but we do not expect large object trees.
This search is VERY FAST compared to Maps, it does not allocate
new instances or uses method calls.
- Specified by:
identityIndexOf in class ElsaStack
- Parameters:
obj - to find in list
- Returns:
- index of object in list or -1 if not found