public class PacketLinkedList<E> extends java.lang.Object implements ListADT<E>
| Constructor and Description |
|---|
PacketLinkedList()
Constructs a empty PacketLinkedList
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(E item)
Adds item to the end of the List.
|
void |
add(int pos,
E item)
Adds item at position pos in the List, moving the items originally in
positions pos through size() - 1 one place to the right to make room.
|
boolean |
contains(E item)
Returns true iff item is in the List (i.e., there is an item x in the List
such that x.equals(item))
|
E |
get(int pos)
Returns the item at position pos in the List.
|
boolean |
isEmpty()
Returns true iff the List is empty.
|
PacketLinkedListIterator<E> |
iterator() |
E |
remove(int pos)
Removes and returns the item at position pos in the List, moving the items
originally in positions pos+1 through size() - 1 one place to the left to
fill in the gap.
|
int |
size()
Returns the number of items in the List.
|
public void add(E item)
ListADTpublic void add(int pos,
E item)
ListADTpublic boolean contains(E item)
ListADTpublic E get(int pos)
ListADTpublic boolean isEmpty()
ListADTpublic E remove(int pos)
ListADTpublic int size()
ListADTpublic PacketLinkedListIterator<E> iterator()
iterator in interface java.lang.Iterable<E>