JavaScript is disabled on your browser.
Enum Constant Summary
Enum Constants
Constructor Summary
Constructors
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
void
Drains the buffer, sending each element to the consumer for processing.
int
Inserts the specified element into this buffer if it is possible to do so immediately without
violating capacity restrictions.
int
Returns the number of elements that have been read from the buffer.
int
Returns the number of elements residing in the buffer.
Returns the enum constant of this class with the specified name.
Returns an array containing the constants of this enum class, in
the order they are declared.
int
Returns the number of elements that have been written to the buffer.
Methods inherited from class java.lang.Enum
clone , compareTo , describeConstable , equals , finalize , getDeclaringClass , hashCode , name , ordinal , toString , valueOf
Constructor Details
DisabledBuffer
private DisabledBuffer ()
Method Details
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
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
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
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