Enum NodeFactory

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<NodeFactory>

    enum NodeFactory
    extends java.lang.Enum<NodeFactory>
    WARNING: GENERATED CODE A factory for cache nodes optimized for a particular configuration.
    • Field Detail

      • RETIRED_STRONG_KEY

        private static final java.lang.Object RETIRED_STRONG_KEY
      • DEAD_STRONG_KEY

        private static final java.lang.Object DEAD_STRONG_KEY
    • Constructor Detail

      • NodeFactory

        private NodeFactory()
    • Method Detail

      • values

        public static NodeFactory[] 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 (NodeFactory c : NodeFactory.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static NodeFactory 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 name
        java.lang.NullPointerException - if the argument is null
      • newNode

        abstract <K,​V> Node<K,​V> newNode​(K key,
                                                     java.lang.ref.ReferenceQueue<K> keyReferenceQueue,
                                                     V value,
                                                     java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
                                                     int weight,
                                                     long now)
        Returns a node optimized for the specified features.
      • newNode

        abstract <K,​V> Node<K,​V> newNode​(java.lang.Object keyReference,
                                                     V value,
                                                     java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
                                                     int weight,
                                                     long now)
        Returns a node optimized for the specified features.
      • newLookupKey

        <K> java.lang.Object newLookupKey​(K key)
        Returns a key suitable for looking up an entry in the cache. If the cache holds keys strongly then the key is returned. If the cache holds keys weakly then a References.LookupKeyReference holding the key argument is returned.
      • newReferenceKey

        <K> java.lang.Object newReferenceKey​(K key,
                                             java.lang.ref.ReferenceQueue<K> referenceQueue)
        Returns a key suitable for inserting into the cache. If the cache holds keys strongly then the key is returned. If the cache holds keys weakly then a References.WeakKeyReference holding the key argument is returned.
      • weakValues

        boolean weakValues()
        Returns whether this factory supports the weak values.
      • softValues

        boolean softValues()
        Returns whether this factory supports the soft values.
      • getFactory

        static NodeFactory getFactory​(boolean strongKeys,
                                      boolean weakKeys,
                                      boolean strongValues,
                                      boolean weakValues,
                                      boolean softValues,
                                      boolean expiresAfterAccess,
                                      boolean expiresAfterWrite,
                                      boolean refreshAfterWrite,
                                      boolean maximumSize,
                                      boolean weighed)
        Returns a factory optimized for the specified features.