Package org.eclipse.net4j.util.ref
Class Interner<E>
- java.lang.Object
- 
- org.eclipse.net4j.util.ref.Interner<E>
 
- 
 public class Interner<E> extends java.lang.Object- Since:
- 3.3
- Author:
- Ed Merks
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classInterner.Entry<E>A weak reference holder that caches the hash code of the referent and is chained in theentriesto handle collisions.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddEntry(Interner.Entry<E> entry)protected Interner.Entry<E>createEntry(E object, int hashCode)protected booleanequals(E object, E otherObject)Returns true if the two objects are to be considered equal.protected Interner.Entry<E>getEntry(int hashCode)Gets the first entry in the table with exactly the given hash code.voidgrow(int minimumCapacity)Ensures that the set has at least the specifies capacity.protected inthashCode(E object)Eintern(E object)
 
- 
- 
- 
Method Detail- 
growpublic void grow(int minimumCapacity) Ensures that the set has at least the specifies capacity. Higher capacity ensures fewer collisions hence faster lookup. Does nothing if the specified capacity is smaller than the current capacity.
 - 
getEntryprotected Interner.Entry<E> getEntry(int hashCode) Gets the first entry in the table with exactly the given hash code. It's very useful to callInterner.Entry.getNextEntry()to yield the next entry with exactly this same hash code.
 - 
hashCodeprotected int hashCode(E object) 
 - 
equalsprotected boolean equals(E object, E otherObject) Returns true if the two objects are to be considered equal. The first object will always be the one passed in as an argument tointern(Object).
 - 
createEntryprotected Interner.Entry<E> createEntry(E object, int hashCode) 
 - 
addEntryprotected void addEntry(Interner.Entry<E> entry) 
 
- 
 
-