|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ListInterface<I>
This interface indicates the public methods that need to be implemented for Homework 3 of CMP-338, Fall 2015.
Method Summary | |
---|---|
void |
add(I obj)
This method is called to add the specified object to the end of the list. |
boolean |
add(I obj,
int index)
This method is called to add the specified object to the list at the given index. |
void |
addSorted(I obj)
This method is called to add the specified object to the list in sorted order. |
I |
getFirstObject()
This method is called to obtain the first object in the list. |
I |
getNextObject()
This method is called to obtain the next object in the list. |
I |
getObject(int index)
This method is called to retrieve the object at the specified index. |
boolean |
isEmpty()
This method is called to determine if the list is empty. |
boolean |
remove(int index)
This method is called to remove the object at the specified index |
void |
removeAll()
This method removes all objects from the list, making the list empty. |
int |
size()
This method is called to obtain the count of elements in the list. |
Method Detail |
---|
boolean isEmpty()
int size()
void add(I obj)
obj
- A reference to the object to be added to the end of the list.
All objects being added to the list must implement the
Comparable interface.Comparable
boolean add(I obj, int index)
obj
- A reference to the object to be added to the list.
All objects being added to the list must implement the
Comparable interface.index
- Indicates the position at which to add the specified object.
Using and index = 0, indicates that the object being added should
become the head of the list and should succeed even if
the list is currently empty.
Comparable
void addSorted(I obj)
obj
- A reference to the Object being added, in sorted order,
to the list. All objects being added to the list must implement the
Comparable interface.Comparable
I getObject(int index)
index
- Indicates the position from which to retrieve the object.
I getFirstObject()
getNextObject()
I getNextObject()
getFirstObject()
boolean remove(int index)
index
- Indicates the position from which to remove the object.
void removeAll()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |