|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface List
Interface describing lists. Lists are collections of data with a head and tail. Values may be added or removed from either end, as well as by value from the middle.
SinglyLinkedList
,
DoublyLinkedList
,
CircularList
Method Summary | |
---|---|
void |
add(int i,
java.lang.Object o)
Insert value at location. |
void |
add(java.lang.Object value)
Add an object to tail of list. |
void |
addFirst(java.lang.Object value)
Add a value to the head of the list. |
void |
addLast(java.lang.Object value)
Add a value to tail of list. |
void |
clear()
Remove all elements of list. |
boolean |
contains(java.lang.Object value)
Check to see if a value is in list. |
java.lang.Object |
get()
Retrieves value from tail of list. |
java.lang.Object |
get(int i)
Get value at location i. |
java.lang.Object |
getFirst()
Fetch first element of list. |
java.lang.Object |
getLast()
Fetch last element of list. |
int |
indexOf(java.lang.Object value)
Determine first location of a value in list. |
boolean |
isEmpty()
Determine if list is empty. |
java.util.Iterator |
iterator()
Construct an iterator to traverse elements of list from head to tail, in order. |
int |
lastIndexOf(java.lang.Object value)
Determine last location of a value in list. |
java.lang.Object |
remove()
Removes value from tail of list. |
java.lang.Object |
remove(int i)
Remove and return value at location i. |
java.lang.Object |
remove(java.lang.Object value)
Remove a value from list. |
java.lang.Object |
removeFirst()
Remove a value from first element of list. |
java.lang.Object |
removeLast()
Remove last value from list. |
java.lang.Object |
set(int i,
java.lang.Object o)
Set value stored at location i to object o, returning old value. |
int |
size()
Determine size of list. |
Methods inherited from interface structure.Structure |
---|
elements, values |
Method Detail |
---|
int size()
size
in interface Structure
boolean isEmpty()
isEmpty
in interface Structure
void clear()
clear
in interface Structure
void addFirst(java.lang.Object value)
value
- The value to be added to the head of the list.void addLast(java.lang.Object value)
value
- The value to be added to tail of list.java.lang.Object getFirst()
java.lang.Object getLast()
java.lang.Object removeFirst()
java.lang.Object removeLast()
java.lang.Object remove(java.lang.Object value)
remove
in interface Structure
value
- The value to be removed.
void add(java.lang.Object value)
add
in interface Structure
value
- The value to be added to tail of list.addLast(java.lang.Object)
java.lang.Object remove()
java.lang.Object get()
boolean contains(java.lang.Object value)
contains
in interface Structure
value
- value sought.
int indexOf(java.lang.Object value)
value
- The value sought.
int lastIndexOf(java.lang.Object value)
value
- value sought.
java.lang.Object get(int i)
i
- position of value to be retrieved.
java.lang.Object set(int i, java.lang.Object o)
i
- location of entry to be changed.o
- new value
void add(int i, java.lang.Object o)
i
- index of this new valueo
- value to be storedjava.lang.Object remove(int i)
i
- position of value to be retrieved.
java.util.Iterator iterator()
iterator
in interface Structure
AbstractIterator
,
Iterator
,
Enumeration
,
Structure.elements()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |