Each object has it's ordinal position.
Public Member Functions | |
Vector () | |
Default Constructor. | |
Vector (int initsize, int incrementSize=0) | |
Constructor with explicit vector size specification. | |
~Vector () | |
Default Destructor. | |
void | clear () |
Clears vector. | |
int | size () const |
Returns number of elements, stored in vector. | |
void | setSize (int newSize) |
Changes vector size. | |
void | ensureCapacity (int minCapacity) |
Ensures, that vector can store specified number of elements without resizing. | |
void | addElement (const T el) |
Adds element into tail of sequence. | |
void | insertElementAt (const T el, int index) |
Inserts element at specified position and expand vector by one element. | |
void | setElementAt (const T el, int index) |
Replaces element at specified position with specified element. | |
void | removeElementAt (int index) |
Removes element at specified index and shift all elements. | |
bool | removeElement (const T el) |
Removes first found element el from vector. | |
int | indexOf (T el, int index) const |
Returns index of element, starting search from specified index parameter. | |
int | indexOf (T el) const |
Returns index of element, starting search from start of vector. | |
T | elementAt (int index) const |
Returns element at specified position. | |
T | lastElement () const |
Returns last element of vector. |
|
Constructor with explicit vector size specification.
|
|
Changes vector size.
if |
|
Replaces element at specified position with specified element. Vector's size is not changed. |
|
Returns index of element, starting search from specified Returns -1, if not found. |
|
Returns index of element, starting search from start of vector. Returns -1, if not found. |
|
Returns element at specified position.
|
|
Returns last element of vector.
|