Enum Class LocalCache.EntryFactory

java.lang.Object
java.lang.Enum<LocalCache.EntryFactory>
com.google.common.cache.LocalCache.EntryFactory
All Implemented Interfaces:
Serializable, Comparable<LocalCache.EntryFactory>, Constable
Enclosing class:
LocalCache<K,V>

static enum LocalCache.EntryFactory extends Enum<LocalCache.EntryFactory>
Creates new entries.
  • Enum Constant Details

  • Field Details

  • Constructor Details

    • EntryFactory

      private EntryFactory()
  • Method Details

    • values

      public static LocalCache.EntryFactory[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LocalCache.EntryFactory valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      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, @CheckForNull ReferenceEntry<K,V> next)
      Creates a new entry.
      Parameters:
      segment - to create the entry for
      key - of the entry
      hash - of the key
      next - 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, K key)
      Copies an entry, assigning it a new next entry.
      Parameters:
      original - the entry to copy. But avoid calling getKey on it: Instead, use the key parameter. That way, we prevent the key from being garbage collected in the case of weak keys. If we create a new entry with a key that is null at construction time, we're not sure if entry will necessarily ever be garbage collected.
      newNext - entry in the same bucket
      key - the key to copy from the original entry to the new one. Use this in preference to original.getKey().
    • 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)