|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.common.collect.Interners
@Beta public final class Interners
Contains static methods pertaining to instances of Interner
.
Method Summary | ||
---|---|---|
static
|
asFunction(Interner<E> interner)
Returns a function that delegates to the Interner.intern(E) method of
the given interner. |
|
static
|
newStrongInterner()
Returns a new thread-safe interner which retains a strong reference to each instance it has interned, thus preventing these instances from being garbage-collected. |
|
static
|
newWeakInterner()
Returns a new thread-safe interner which retains a weak reference to each instance it has interned, and so does not prevent these instances from being garbage-collected. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <E> Interner<E> newStrongInterner()
newWeakInterner()
. Note that unlike String.intern()
, using this interner does not consume memory in the
permanent generation.
public static <E> Interner<E> newWeakInterner()
newStrongInterner()
, but is the best alternative when the memory
usage of that implementation is unacceptable. Note that unlike String.intern()
, using this interner does not consume memory in the
permanent generation.
public static <E> Function<E,E> asFunction(Interner<E> interner)
Interner.intern(E)
method of
the given interner.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |