|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Required methods for the Vector ADT.
Method Summary | |
void |
add(Object anObject)
Adds the given object to the end of this, increasing the size of this by 1. |
Object |
elementAtRank(int aRank)
Returns the object at the given rank. |
void |
insertAtRank(int aRank,
Object anObject)
Inserts the given object into this at the given rank, increasing the size of this by 1. |
boolean |
isEmpty()
Returns whether or not this is empty. |
Object |
removeAtRank(int aRank)
Removes and returns the object at the given rank, reducing the size of this by 1. |
Object |
replaceElement(int aRank,
Object anObject)
Sets this to store the given object at the given rank, and returns the object that was replaced at that rank. |
int |
size()
Returns the number of elements in this. |
Method Detail |
public void add(Object anObject)
anObject
- object to addpublic void insertAtRank(int aRank, Object anObject)
aRank
- rank at which to insert objectanObject
- object to insertpublic Object removeAtRank(int aRank)
aRank
- rank from which to remove objectpublic Object elementAtRank(int aRank)
aRank
- rank of object to returnpublic Object replaceElement(int aRank, Object anObject)
aRank
- rank of object to storeanObject
- object to storepublic int size()
public boolean isEmpty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |