public class LinkedList1L<T> extends LinkedListSecondary<T>
Constructor and Description |
---|
LinkedList1L() |
Modifier and Type | Method and Description |
---|---|
void |
add(T entry)
Appends
entry to the end of #this. |
void |
addToFront(T entry)
Adds
entry to the front of #this. |
void |
advance()
Shifts
#this.focus forward by 1 position. |
void |
clear()
Resets
this to its initial value. |
T |
focus()
Returns a reference to
#this.focus . |
void |
insert(T entry)
Inserts
entry into #this at the position directly
following the #this.focus . |
java.util.Iterator<T> |
iterator() |
int |
length()
Returns the number of entries in
this . |
void |
moveToFront()
Shifts
this.focus to the front of the list. |
void |
moveToRear()
Moves
#this.focus to the last entry in this . |
LinkedList<T> |
newInstance()
Returns a new object with the same dynamic type as
this , having
an initial value. |
int |
position()
Returns the position of
#this.focus . |
T |
remove()
Removes
this.focus and returns it to the caller. |
void |
retreat()
Shifts
this.focus to the entry previous to #this.focus . |
void |
transferFrom(LinkedList<T> source)
Sets
this to the incoming value of source, and resets
source to an initial value; the declaration notwithstanding, the
dynamic type of source must be the same as the dynamic type of
this . |
contains, equals, hashCode, moveToPosition, removeFront, removeRear, toString
public void add(T entry)
LinkedListKernel
entry
to the end of #this.entry
- item to be appended to this
public void addToFront(T entry)
LinkedListKernel
entry
to the front of #this.entry
- item to be prepended to this
public T remove()
LinkedListKernel
this.focus
and returns it to the caller.
this.focus
will be shifted to the right, and if
#this.focus
was the last entry, then this.focus
shifts to
the first entry in #this
.#this.focus
public void advance()
LinkedListKernel
#this.focus
forward by 1 position.public void retreat()
LinkedListKernel
this.focus
to the entry previous to #this.focus
.public void moveToFront()
LinkedListKernel
this.focus
to the front of the list.public int length()
LinkedListKernel
this
.this
public void insert(T entry)
LinkedListKernel
entry
into #this
at the position directly
following the #this.focus
.entry
- entry to be inserted into the listpublic T focus()
LinkedListKernel
#this.focus
.#this.focus
public void moveToRear()
LinkedListKernel
#this.focus
to the last entry in this
.public int position()
LinkedListKernel
#this.focus
.this.focus
fron the front of the listpublic void clear()
Standard
this
to its initial value.public void transferFrom(LinkedList<T> source)
Standard
this
to the incoming value of source, and resets
source
to an initial value; the declaration notwithstanding, the
dynamic type of source
must be the same as the dynamic type of
this
. If the type T has a no-argument constructor, then
source
satisfies the contract of the no-argument constructor for
T. If T does not have a no-argument constructor, then source satisfies
the contract of the constructor call that was used to initialize
#source
.source
- object whose value is to be transferredpublic LinkedList<T> newInstance()
Standard
this
, having
an initial value. If the type T has a no-argument constructor, then the
value of the new returned object satisfies the contract of the
no-argument constructor for T. If T does not have a no-argument
constructor, then the value of the new returned object satisfies the
contract of the constructor call that was used to initialize
this
.this
with an initial valuepublic java.util.Iterator<T> iterator()