public class DLCyclicList<T>
extends java.lang.Object
implements java.lang.Iterable<T>
Modifier and Type | Class and Description |
---|---|
static class |
DLCyclicList.DLNode<T> |
Modifier and Type | Field and Description |
---|---|
protected DLCyclicList.DLNode<T> |
entry |
protected int |
size |
Constructor and Description |
---|
DLCyclicList() |
Modifier and Type | Method and Description |
---|---|
T |
delete(DLCyclicList.DLNode<T> nd)
Deletes a node from the list and returns its object.
|
DLCyclicList.DLNode<T> |
findNode(java.lang.Object obj)
Finds the element containing given object.
|
DLCyclicList.DLNode<T> |
getEntry() |
DLCyclicList.DLNode<T> |
getFirst() |
int |
getSize()
Returns the number of elements in this cyclic list.
|
boolean |
isEmpty()
Returns true if the list is empty
|
java.util.Iterator<T> |
iterator() |
static void |
main(java.lang.String[] args) |
void |
pushAfter(T obj,
DLCyclicList.DLNode<T> n)
Adds an object after the specified node in the list.
|
void |
pushBefore(T obj)
Adds the object before the entry of the list.
|
void |
pushBefore(T obj,
DLCyclicList.DLNode<T> n)
Adds an object before the specified node in the list.
|
void |
setEntry(DLCyclicList.DLNode<T> n) |
protected DLCyclicList.DLNode<T> entry
protected int size
public boolean isEmpty()
public DLCyclicList.DLNode<T> getFirst()
public DLCyclicList.DLNode<T> findNode(java.lang.Object obj)
public DLCyclicList.DLNode<T> getEntry()
public void setEntry(DLCyclicList.DLNode<T> n)
public void pushBefore(T obj)
public void pushBefore(T obj, DLCyclicList.DLNode<T> n)
public void pushAfter(T obj, DLCyclicList.DLNode<T> n)
public T delete(DLCyclicList.DLNode<T> nd)
public int getSize()
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public static void main(java.lang.String[] args)