Package org.mapdb.elsa
Class ElsaStack.IdentityArray
- java.lang.Object
-
- org.mapdb.elsa.ElsaStack
-
- org.mapdb.elsa.ElsaStack.IdentityArray
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.mapdb.elsa.ElsaStack
ElsaStack.IdentityArray, ElsaStack.MapStack, ElsaStack.NoReferenceStack
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object[]databooleanforwardRefsprivate intsize
-
Constructor Summary
Constructors Constructor Description IdentityArray()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Object o)java.lang.ObjectgetInstance(int i)intgetSize()intidentityIndexOf(java.lang.Object obj)This method is reason why ArrayList is not used.-
Methods inherited from class org.mapdb.elsa.ElsaStack
addClassInfo, resolveClassId, resolveClassInfo
-
-
-
-
Method Detail
-
identityIndexOf
public int identityIndexOf(java.lang.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:
identityIndexOfin classElsaStack- Parameters:
obj- to find in list- Returns:
- index of object in list or -1 if not found
-
getInstance
public java.lang.Object getInstance(int i)
- Specified by:
getInstancein classElsaStack
-
-