Links, so there is no performance penalty for locating object in the list.
The Chain implementation is not thread safe.
| Modifier and Type | Field and Description |
|---|---|
| private Link | firstLink
The first link in the chain |
| private Link | lastLink
The last link in the chain |
| private int | size
The size of the chain (number of elements stored). |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Link | |
| public Link | |
| public boolean | |
| public void | moveTowardsHead(final Link<E>
the link)Link to be moved.Moves the |
| public void | |
| public void | |
| public Link | |
| public Link | |
| public boolean | |
| public int |
| firstLink | back to summary |
|---|---|
| private Link<E> firstLink The first link in the chain | |
| lastLink | back to summary |
|---|---|
| private Link<E> lastLink The last link in the chain | |
| size | back to summary |
|---|---|
| private int size The size of the chain (number of elements stored). | |
| Chain | back to summary |
|---|---|
| pack-priv Chain() | |
| getFirstLink | back to summary |
|---|---|
| public Link Returns the first | |
| getLastLink | back to summary |
|---|---|
| public Link Returns the last | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns true if this Chain doesn't have any element stored, or false otherwise. | |
| moveTowardsHead | back to summary |
|---|---|
| public void moveTowardsHead(final Link<E> link) Moves the | |
| offerFirst | back to summary |
|---|---|
| public void offerFirst(final Link<E> link) Adds a | |
| offerLast | back to summary |
|---|---|
| public void offerLast(final Link<E> link) Adds a | |
| pollFirst | back to summary |
|---|---|
| public Link Removes and returns the first | |
| pollLast | back to summary |
|---|---|
| public Link Removes and returns the last | |
| remove | back to summary |
|---|---|
| public boolean remove(final Link<E> link) Removes the | |
| size | back to summary |
|---|---|
| public int size() Returns the number of elements stored in this Chain. | |