ptolemy.actor.gt.data
Class FastLinkedList.Entry

java.lang.Object
  extended by ptolemy.actor.gt.data.FastLinkedList.Entry
Enclosing class:
FastLinkedList<E>

public class FastLinkedList.Entry
extends java.lang.Object

An entry in this linked list that contains an element.

Since:
Ptolemy II 8.0
Version:
$Id: FastLinkedList.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Field Summary
private  E _element
          The element.
private  FastLinkedList<E> _list
          The linked list containing this entry.
private  FastLinkedList.Entry _next
          The next entry, or null.
private  FastLinkedList.Entry _previous
          The previous entry, or null.
 
Constructor Summary
private FastLinkedList.Entry(FastLinkedList<E> list, E element)
          Construct an entry in a linked list with an element.
 
Method Summary
 E getElement()
          Get the element in this entry.
 FastLinkedList<E> getList()
          Get the linked list that contains this entry.
 FastLinkedList.Entry getNext()
          Get the next entry.
 FastLinkedList.Entry getPrevious()
          Get the previous entry.
 boolean hasNext()
          Test whether there is a next entry.
 boolean hasPrevious()
          Test whether there is a previous entry.
 void remove()
          Remove this entry from the linked list that contains it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_element

private E _element
The element.


_list

private FastLinkedList<E> _list
The linked list containing this entry.


_next

private FastLinkedList.Entry _next
The next entry, or null.


_previous

private FastLinkedList.Entry _previous
The previous entry, or null.

Constructor Detail

FastLinkedList.Entry

private FastLinkedList.Entry(FastLinkedList<E> list,
                             E element)
Construct an entry in a linked list with an element.

Parameters:
list - The linked list.
element - The element.
Method Detail

getElement

public E getElement()
Get the element in this entry.

Returns:
The element.

getList

public FastLinkedList<E> getList()
Get the linked list that contains this entry.

Returns:
The linked list.

getNext

public FastLinkedList.Entry getNext()
Get the next entry.

Returns:
The next entry, or null if this entry is at the tail.

getPrevious

public FastLinkedList.Entry getPrevious()
Get the previous entry.

Returns:
The next entry, or null if this entry is at the head.

hasNext

public boolean hasNext()
Test whether there is a next entry.

Returns:
true if there is a next entry.

hasPrevious

public boolean hasPrevious()
Test whether there is a previous entry.

Returns:
true if there is a previous entry.

remove

public void remove()
Remove this entry from the linked list that contains it.