public class LinkedList<E>
extends java.lang.Object
implements java.io.Serializable
The linked list implementation was specifically written for the CoolServlets cache system. While it can be used as a general purpose linked list, for most applications, it is more suitable to use the linked list that is part of the Java Collections package.
| 限定符和类型 | 字段和说明 |
|---|---|
static long |
serialVersionUID |
| 构造器和说明 |
|---|
LinkedList()
Creates a new linked list.
|
| 限定符和类型 | 方法和说明 |
|---|---|
LinkedListNode<E> |
addFirst(E object)
Adds an object to the beginning of the list by automatically creating a
a new node and adding it to the beginning of the list.
|
LinkedListNode<E> |
addFirst(LinkedListNode<E> node)
Adds a node to the beginning of the list.
|
LinkedListNode<E> |
addLast(E object)
Adds an object to the end of the list by automatically creating a
a new node and adding it to the end of the list.
|
LinkedListNode<E> |
addLast(LinkedListNode<E> node)
把节点添加到链表最后。
|
void |
clear()
Erases all elements in the list and re-initializes it.
|
LinkedListNode<E> |
first()
Returns the first linked list node in the list.
|
boolean |
isInvalidNode(LinkedListNode<E> node)
判断节点是否无效节点。
|
LinkedListNode<E> |
last()
Returns the last linked list node in the list.
|
LinkedListNode<E> |
linkAfter(E e,
LinkedListNode<E> succ)
在指定节点后插入元素。
|
LinkedListNode<E> |
linkBefore(E e,
LinkedListNode<E> succ)
在指定节点前插入元素。
|
E |
pop()
删除第一个节点。
|
int |
size()
获取链表大小。
|
java.lang.String |
toString()
Returns a String representation of the linked list with a comma
delimited list of all the elements in the list.
|
E |
unlink(LinkedListNode<E> x)
删除指定节点。
|
public static final long serialVersionUID
public LinkedListNode<E> first()
public LinkedListNode<E> last()
public LinkedListNode<E> addFirst(LinkedListNode<E> node)
node - the node to add to the beginning of the list.public LinkedListNode<E> addFirst(E object)
object - the object to add to the beginning of the list.public LinkedListNode<E> addLast(LinkedListNode<E> node)
node - public LinkedListNode<E> addLast(E object)
object - the object to add to the end of the list.public LinkedListNode<E> linkAfter(E e, LinkedListNode<E> succ)
e - 插入的元素。succ - 在此节点前插入元素。public LinkedListNode<E> linkBefore(E e, LinkedListNode<E> succ)
e - 插入的元素。succ - 在此节点前插入元素。public E unlink(LinkedListNode<E> x)
x - public E pop()
public final boolean isInvalidNode(LinkedListNode<E> node)
node - public void clear()
public int size()
public java.lang.String toString()
toString 在类中 java.lang.ObjectCopyright © 2001-2014 hynnet.com