Top Description Fields Constructors Methods
org.glassfish.grizzly.connectionpool

pack-priv final Class Chain<E>

extends Object
Class Inheritance
Imports
java.util.LinkedList

Minimalistic linked list implementation. This implementation doesn't work directly with objects, but their Links, so there is no performance penalty for locating object in the list. The Chain implementation is not thread safe.
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
private Link<E>
firstLink

The first link in the chain

private Link<E>
lastLink

The last link in the chain

private int
size

The size of the chain (number of elements stored).

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
isEmpty()

Returns true if this Chain doesn't have any element stored, or false otherwise.

public Link<E>
pollFirst()

Removes and returns the first Link of this Chain.

public Link<E>
pollLast()

Removes and returns the last Link of this Chain.

public int
size()

Returns the number of elements stored in this Chain.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sizeback to summary
private int size

The size of the chain (number of elements stored).

Constructor Detail

Chainback to summary
pack-priv Chain()

Method Detail

isEmptyback to summary
public boolean isEmpty()

Returns true if this Chain doesn't have any element stored, or false otherwise.

pollFirstback to summary
public Link<E> pollFirst()

Removes and returns the first Link of this Chain.

pollLastback to summary
public Link<E> pollLast()

Removes and returns the last Link of this Chain.

sizeback to summary
public int size()

Returns the number of elements stored in this Chain.