org.mapdb
Class SerializerBase.FastArrayList<K>
java.lang.Object
org.mapdb.SerializerBase.FastArrayList<K>
- Enclosing class:
- SerializerBase
protected static final class SerializerBase.FastArrayList<K>
- extends Object
Utility class similar to ArrayList, but with fast identity search.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
size
public int size
data
public K[] data
forwardRefs
public boolean forwardRefs
SerializerBase.FastArrayList
public SerializerBase.FastArrayList()
add
public void add(K o)
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.
- Parameters:
obj - to find in list
- Returns:
- index of object in list or -1 if not found
Copyright © 2014. All Rights Reserved.