Enum DisabledBuffer
- java.lang.Object
-
- java.lang.Enum<DisabledBuffer>
-
- com.github.benmanes.caffeine.cache.DisabledBuffer
-
- All Implemented Interfaces:
Buffer<java.lang.Object>
,java.io.Serializable
,java.lang.Comparable<DisabledBuffer>
enum DisabledBuffer extends java.lang.Enum<DisabledBuffer> implements Buffer<java.lang.Object>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
DisabledBuffer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drainTo(java.util.function.Consumer<java.lang.Object> consumer)
Drains the buffer, sending each element to the consumer for processing.int
offer(java.lang.Object e)
Inserts the specified element into this buffer if it is possible to do so immediately without violating capacity restrictions.int
reads()
Returns the number of elements that have been read from the buffer.int
size()
Returns the number of elements residing in the buffer.static DisabledBuffer
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DisabledBuffer[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.int
writes()
Returns the number of elements that have been written to the buffer.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final DisabledBuffer INSTANCE
-
-
Method Detail
-
values
public static DisabledBuffer[] 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 (DisabledBuffer c : DisabledBuffer.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DisabledBuffer 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
-
offer
public int offer(java.lang.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.
-
drainTo
public void drainTo(java.util.function.Consumer<java.lang.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.
-
size
public int size()
Description copied from interface:Buffer
Returns the number of elements residing in the buffer.
-
reads
public int reads()
Description copied from interface:Buffer
Returns the number of elements that have been read from the buffer.
-
-