Class Vector
This class represents a Vector, in which you can add objects of the type String..
Syntax
Constructors
Vector(Integer[])
Pass a number array to convert into a new object.
Declaration
Vector Vector(Integer[] value)
Parameters
Type | Name | Description |
---|---|---|
Integer[] | value | An Integer array. |
Returns
Type | Description |
---|---|
Vector |
Methods
parseString(String, String)
Parses a text into a vector. The fields in the string are separated by the given delimiter.
Declaration
Void parseString(String text, String delimiter)
Parameters
Type | Name | Description |
---|---|---|
String | text | The string to be parsed. |
String | delimiter | The delimiter for the fields. |
Remarks
This method does not support escaped characters.
pushBack(String)
Pushes a string object to the end of the vector.
Declaration
pushBack(String element)
Parameters
Type | Name | Description |
---|---|---|
String | element | The string object to push on the vector. |
set(Integer, String)
Sets the value at the specified index.
Declaration
Void set(Integer index, String value)
Parameters
Type | Name | Description |
---|---|---|
Integer | index | The index of the vector to set the value. |
String | value | The value to set at the specified index. |
Remarks
If the index specified is out of bounds, a RunTimeException will be raised.
get(Integer)
Returns an element in the vector at the given position.
Declaration
String get(Integer index)
Parameters
Type | Name | Description |
---|---|---|
Integer | index | The index (starting at 0) of the element to be retrieved. |
Returns
Type | Description |
---|---|
String |
Remarks
If the index specified is out of bounds, a RunTimeException will be raised.
size()
Returns the size of the vector.
Declaration
Integer size()
Returns
Type | Description |
---|---|
Integer |
toIntegerArray()
Convert a vector to an integer array.
Declaration
Integer[] toIntegerArray()
Returns
Type | Description |
---|---|
Integer[] |
Remarks
Invalid values will be represented as null.
toStringArray()
Convert a vector to a string array.
Declaration
String[] toStringArray()
Returns
Type | Description |
---|---|
String[] |
buildString(String)
Returns a string of all the elements in the vector, separated by the specified delimiter.
Declaration
String buildString(String delimiter)
Parameters
Type | Name | Description |
---|---|---|
String | delimiter | The delimiter used for separating the elements. |
Returns
Type | Description |
---|---|
String | A string with all the elements separated by the delimiter. |
Remarks
not escape any characters which might be equal to the delimiter.
removeAt(Integer)
Removes an element at the specified index.
Declaration
Void removeAt(Integer index)
Parameters
Type | Name | Description |
---|---|---|
Integer | index | The index (starting at 0) of the element to remove from the vector. |