Package org.eclipse.net4j.util.ref
Klasse Interner<E>
java.lang.Object
org.eclipse.net4j.util.ref.Interner<E>
- Seit:
- 3.3
- Autor:
- Ed Merks
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungprotected static class
A weak reference holder that caches the hash code of the referent and is chained in theentries
to handle collisions. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
addEntry
(Interner.Entry<E> entry) Adds a new entry,ensures
the capacity is sufficient and increases thesize
.protected Interner.Entry
<E> createEntry
(E object, int hashCode) protected boolean
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.void
grow
(int minimumCapacity) Ensures that the set has at least the specifies capacity.protected int
-
Konstruktordetails
-
Interner
public Interner() -
Interner
public Interner(int minimumCapacity)
-
-
Methodendetails
-
grow
public 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. -
intern
-
getEntry
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. -
hashCode
-
equals
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)
. -
createEntry
-
addEntry
Adds a new entry,ensures
the capacity is sufficient and increases thesize
.
-