public class StringVector
extends java.util.ArrayList
Constructor and Description |
---|
StringVector()
Constructs an empty vector.
|
StringVector(int initialCapacity)
Constructs an empty StringVector with the specified storage capacity.
|
StringVector(java.lang.String str)
Constructs a StringVector from a String by splitting the String by new line and adding them one by one to the
StringVector.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(java.lang.Object el) |
void |
append(StringVector s)
Adds the elements of the given StringVector to the end of the present one, by reference.
|
java.lang.String |
at(int index)
Returns the String element at the specified index.
|
StringVector |
copy() |
void |
copyInto(java.lang.Object[] objects)
copies this string vector into the object array
|
java.lang.Object |
elementAt(int el) |
java.util.Enumeration |
elements() |
java.lang.String |
first()
Returns the first element of the sequence.
|
int |
indexOf(java.lang.Object el,
int s) |
java.lang.Object |
last()
Returns the last element of the sequence.
|
void |
removeAllElements() |
void |
removeElementAt(int i) |
void |
setElementAt(java.lang.String str,
int i) |
void |
sort()
Sorts the string vector into ascending alpabetical order.
|
java.lang.String |
toAString() |
double[] |
toDoubles() |
int[] |
toInts() |
java.lang.String |
toNewLineString() |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
public StringVector(int initialCapacity)
initialCapacity
- the initial storage capacity of the vectorpublic StringVector(java.lang.String str) throws java.lang.Exception
java.lang.Exception
public StringVector()
public final java.lang.String at(int index)
index
- the index of the desired elementjava.lang.ArrayIndexOutOfBoundsException
- If an invalid index was given.public final java.lang.String first()
java.util.NoSuchElementException
- If the sequence is empty.public final java.lang.Object last()
java.util.NoSuchElementException
- If the sequence is empty.public final java.lang.String toAString()
public final java.lang.String toNewLineString()
public final double[] toDoubles()
public final int[] toInts()
public StringVector copy()
public void copyInto(java.lang.Object[] objects)
public java.util.Enumeration elements()
public void sort()
public void append(StringVector s)
s
- The StringVector to be appendedpublic void addElement(java.lang.Object el)
public java.lang.Object elementAt(int el)
public void removeElementAt(int i)
public void setElementAt(java.lang.String str, int i)
public int indexOf(java.lang.Object el, int s)
public void removeAllElements()