|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--JavaVector
Java Vector IVector implementation.
Field Summary | |
protected Vector |
elements
Java Vector used to store the elements of this. |
Constructor Summary | |
JavaVector()
Constructs a new Java vector. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Vector elements
Constructor Detail |
public JavaVector()
Method Detail |
public void add(Object anObject)
add
in interface IVector
anObject
- object to addpublic void insertAtRank(int aRank, Object anObject)
insertAtRank
in interface IVector
aRank
- rank at which to insert objectanObject
- object to insertpublic Object removeAtRank(int aRank)
removeAtRank
in interface IVector
aRank
- rank from which to remove objectpublic Object elementAtRank(int aRank)
elementAtRank
in interface IVector
aRank
- rank of object to returnpublic Object replaceElement(int aRank, Object anObject)
replaceElement
in interface IVector
aRank
- rank of object to storeanObject
- object to storepublic int size()
size
in interface IVector
public boolean isEmpty()
isEmpty
in interface IVector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |