|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for a vector.
Method Summary | |
Object |
elemAtRank(int r)
Returns the element stored at the given rank. |
void |
insertAtRank(int r,
Object e)
Inserts an element at the given rank. |
boolean |
isEmpty()
Returns whether the vector is empty. |
Object |
removeAtRank(int r)
Removes the element stored at the given rank. |
Object |
replaceAtRank(int r,
Object e)
Replaces the element stored at the given rank. |
int |
size()
Returns the number of elements in the vector. |
Method Detail |
public int size()
public boolean isEmpty()
public Object elemAtRank(int r) throws BoundaryViolationException
r
- Rank to query
BoundaryViolationException
- if r < 0 or
r > size()
- 1public Object replaceAtRank(int r, Object e) throws BoundaryViolationException
r
- Rank at which to replace
BoundaryViolationException
- if r < 0 or
r > size()
- 1public void insertAtRank(int r, Object e) throws BoundaryViolationException
r
- Rank at which to replace
BoundaryViolationException
- if r < 0 or
r > size()
public Object removeAtRank(int r) throws BoundaryViolationException
r
- Rank at which to replace
BoundaryViolationException
- if r < 0 or
r > size()
- 1
|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |