Enum Class DisabledBuffer

java.lang.Object
java.lang.Enum<DisabledBuffer>
com.github.benmanes.caffeine.cache.DisabledBuffer
All Implemented Interfaces:
Buffer<Object>, Serializable, Comparable<DisabledBuffer>, Constable

enum DisabledBuffer extends Enum<DisabledBuffer> implements Buffer<Object>
  • Enum Constant Details

  • Constructor Details

    • DisabledBuffer

      private DisabledBuffer()
  • Method Details

    • values

      public static DisabledBuffer[] 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 DisabledBuffer 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
    • offer

      public int offer(Object e)
      Description copied from interface: Buffer
      Inserts the specified element into this buffer if it is possible to do so immediately without violating capacity restrictions. The addition is allowed to fail spuriously if multiple threads insert concurrently.
      Specified by:
      offer in interface Buffer<Object>
      Parameters:
      e - the element to add
      Returns:
      1 if the buffer is full, -1 if the CAS failed, or 0 if added
    • drainTo

      public void drainTo(Consumer<Object> consumer)
      Description copied from interface: Buffer
      Drains the buffer, sending each element to the consumer for processing. The caller must ensure that a consumer has exclusive read access to the buffer.
      Specified by:
      drainTo in interface Buffer<Object>
      Parameters:
      consumer - the action to perform on each element
    • size

      public int size()
      Description copied from interface: Buffer
      Returns the number of elements residing in the buffer.
      Specified by:
      size in interface Buffer<Object>
      Returns:
      the number of elements in this buffer
    • reads

      public int reads()
      Description copied from interface: Buffer
      Returns the number of elements that have been read from the buffer.
      Specified by:
      reads in interface Buffer<Object>
      Returns:
      the number of elements read from this buffer
    • writes

      public int writes()
      Description copied from interface: Buffer
      Returns the number of elements that have been written to the buffer.
      Specified by:
      writes in interface Buffer<Object>
      Returns:
      the number of elements written to this buffer