public interface IntegerVector extends Vector<Integer>
Vector
are optional. Implementations that are not modifiable should throw an UnsupportedOperationException
if such methods are called. These methods are
marked as "optional" in the specification for the interface.Modifier and Type | Method and Description |
---|---|
int |
add(int index,
int delta)
Changes the value in the vector by a specified amount (optional
operation).
|
int |
get(int index)
Returns the value of this vector at the given index.
|
Integer |
getValue(int index)
Returns the value of the vector at the given index as a
Integer . |
void |
set(int index,
int value)
Sets the value in this vector (optional operation).
|
int[] |
toArray()
Returns an
int array representing this vector. |
int add(int index, int delta)
index
- index to change.delta
- the amount to change by.int get(int index)
index
- index to retrieve.Integer getValue(int index)
Integer
.void set(int index, int value)
index
- index to set.value
- value to set in the vector.int[] toArray()
int
array representing this vector. The returned
array will be "safe" in that no changes to the array will be reflected in
the vector, and likewise for changes to to the vector. The caller is
thus free to modify the returned array.int
array of this vector.Copyright © 2012. All Rights Reserved.