T - The type of the elements in the linked list.public final class Link<T>
extends java.lang.Object
implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
Link<T> |
next
This attribute points to the next link in the list.
|
Link<T> |
previous
This attribute points to the previous link in the list.
|
T |
value
This attribute contains the value encapsulated by this link.
|
| Constructor and Description |
|---|
Link(T value)
This constructor takes a value and creates a
Link that encapsulates it. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object object) |
int |
hashCode() |
static <T> void |
insertBeforeLink(Link<T> newLink,
Link<T> existingLink)
This utility method inserts a new link in a linked list before the specified existing link.
|
static <T> void |
removeLink(Link<T> link)
This utility method removes the specified link from a linked list.
|
static <T> void |
removeLinks(Link<T> firstLink,
Link<T> lastLink)
This utility method removes a set of links from a linked list, starting with the first
link and including the link before the lastLink.
|
public T value
public Link(T value)
Link that encapsulates it.value - The value to be encapsulated in a link.public boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.Objectpublic static <T> void insertBeforeLink(Link<T> newLink, Link<T> existingLink)
T - The type of element encapsulated by the link.newLink - The new link to be inserted.existingLink - The existing link before which the new link will be inserted.public static <T> void removeLink(Link<T> link)
T - The type of element encapsulated by the link.link - The link to be removed.public static <T> void removeLinks(Link<T> firstLink, Link<T> lastLink)
T - The type of element encapsulated by the link.firstLink - The first link in the sub chain to be removed.lastLink - The link after the last link in the sub chain to be removed.Copyright © 2015 Crater Dog Technologies(TM). All rights reserved.