Package com.google.common.cache
Enum LocalCache.EntryFactory
- java.lang.Object
-
- java.lang.Enum<LocalCache.EntryFactory>
-
- com.google.common.cache.LocalCache.EntryFactory
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<LocalCache.EntryFactory>
- Enclosing class:
- LocalCache<K,V>
static enum LocalCache.EntryFactory extends java.lang.Enum<LocalCache.EntryFactory>
Creates new entries.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description STRONG
STRONG_ACCESS
STRONG_ACCESS_WRITE
STRONG_WRITE
WEAK
WEAK_ACCESS
WEAK_ACCESS_WRITE
WEAK_WRITE
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
ACCESS_MASK
(package private) static LocalCache.EntryFactory[]
factories
Look-up table for factories.(package private) static int
WEAK_MASK
(package private) static int
WRITE_MASK
-
Constructor Summary
Constructors Modifier Constructor Description private
EntryFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) <K,V>
voidcopyAccessEntry(ReferenceEntry<K,V> original, ReferenceEntry<K,V> newEntry)
(package private) <K,V>
ReferenceEntry<K,V>copyEntry(LocalCache.Segment<K,V> segment, ReferenceEntry<K,V> original, ReferenceEntry<K,V> newNext)
Copies an entry, assigning it a newnext
entry.(package private) <K,V>
voidcopyWriteEntry(ReferenceEntry<K,V> original, ReferenceEntry<K,V> newEntry)
(package private) static LocalCache.EntryFactory
getFactory(LocalCache.Strength keyStrength, boolean usesAccessQueue, boolean usesWriteQueue)
(package private) abstract <K,V>
ReferenceEntry<K,V>newEntry(LocalCache.Segment<K,V> segment, K key, int hash, ReferenceEntry<K,V> next)
Creates a new entry.static LocalCache.EntryFactory
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static LocalCache.EntryFactory[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STRONG
public static final LocalCache.EntryFactory STRONG
-
STRONG_ACCESS
public static final LocalCache.EntryFactory STRONG_ACCESS
-
STRONG_WRITE
public static final LocalCache.EntryFactory STRONG_WRITE
-
STRONG_ACCESS_WRITE
public static final LocalCache.EntryFactory STRONG_ACCESS_WRITE
-
WEAK
public static final LocalCache.EntryFactory WEAK
-
WEAK_ACCESS
public static final LocalCache.EntryFactory WEAK_ACCESS
-
WEAK_WRITE
public static final LocalCache.EntryFactory WEAK_WRITE
-
WEAK_ACCESS_WRITE
public static final LocalCache.EntryFactory WEAK_ACCESS_WRITE
-
-
Field Detail
-
ACCESS_MASK
static final int ACCESS_MASK
- See Also:
- Constant Field Values
-
WRITE_MASK
static final int WRITE_MASK
- See Also:
- Constant Field Values
-
WEAK_MASK
static final int WEAK_MASK
- See Also:
- Constant Field Values
-
factories
static final LocalCache.EntryFactory[] factories
Look-up table for factories.
-
-
Method Detail
-
values
public static LocalCache.EntryFactory[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LocalCache.EntryFactory c : LocalCache.EntryFactory.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LocalCache.EntryFactory valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getFactory
static LocalCache.EntryFactory getFactory(LocalCache.Strength keyStrength, boolean usesAccessQueue, boolean usesWriteQueue)
-
newEntry
abstract <K,V> ReferenceEntry<K,V> newEntry(LocalCache.Segment<K,V> segment, K key, int hash, ReferenceEntry<K,V> next)
Creates a new entry.- Parameters:
segment
- to create the entry forkey
- of the entryhash
- of the keynext
- entry in the same bucket
-
copyEntry
<K,V> ReferenceEntry<K,V> copyEntry(LocalCache.Segment<K,V> segment, ReferenceEntry<K,V> original, ReferenceEntry<K,V> newNext)
Copies an entry, assigning it a newnext
entry.- Parameters:
original
- the entry to copynewNext
- entry in the same bucket
-
copyAccessEntry
<K,V> void copyAccessEntry(ReferenceEntry<K,V> original, ReferenceEntry<K,V> newEntry)
-
copyWriteEntry
<K,V> void copyWriteEntry(ReferenceEntry<K,V> original, ReferenceEntry<K,V> newEntry)
-
-