Java Utililty Methods Vector from String

List of utility methods to do Vector from String

Description

The list of methods to do Vector from String are organized into topic(s).

Method

StringconstructFilter(String hostname, Vector schedulertypes)
what is this used for?
StringBuffer filter = new StringBuffer();
filter.append("(&(objectclass=GlobusServiceJobManager)(hn=");
filter.append(hostname);
if (hostname.indexOf("*") == -1)
    filter.append("*");
filter.append(")");
int size = schedulertypes.size();
if (size != 0) {
...
booleancontainSource(Vector sources, String source)
contain Source
if (sources == null || sources.size() == 0)
    return false;
String s = null;
for (int i = 0; i < sources.size(); i++) {
    s = (String) sources.elementAt(i);
    if (s.compareTo(source) == 0)
        return true;
return false;
VectorconvertStringToVector(String source, String separator)
Convert the passed String into a vector
if (source == null || separator == null) {
    return null;
Vector v = new Vector();
StringTokenizer st = new StringTokenizer(source, separator);
while (st.hasMoreTokens()) {
    v.addElement(st.nextToken().trim());
return v;
double[]createNodeValueVector(final String val)
create Node Value Vector
final StringTokenizer tokr = new StringTokenizer(val, DELIM + ",\"");
return new double[tokr.countTokens()];
VectorgetKeyStringAsVector(String keyString, String separator)
Return a vector of strings with one element per key value NOTE: An empty string ("") will be regarded as a value, therefor is StringTokenizer not used.
if (keyString == null) {
    return null;
Vector v = new Vector();
int xb = 0;
int xe = 0;
boolean loop = true;
while (loop) {
...
intgetposString(Vector vect_valores, String valor)

Returns the position of the element at the vector, -1 if does not appear

for (int i = 0; i < vect_valores.size(); i++)
    if (vect_valores.elementAt(i).equals(valor))
        return (i);
return (-1);
StringgetStringFromTokens(Vector vector, String delimiter)
Return a String who contains the strings in the Vector vector separated by delimiter.
int nelem = vector.size();
StringBuffer str_ret = new StringBuffer(nelem * delimiter.length());
for (int i = 0; i < nelem; i++) {
    str_ret.append(vector.elementAt(i));
    if (i < nelem - 1) {
        str_ret.append(delimiter);
return str_ret.toString();
Stringimplode(Vector handler, String separator)
implode, link a vector into a string with a separate string
StringBuffer strbuf = new StringBuffer();
try {
    if (!handler.isEmpty()) {
        int len = handler.size();
        for (int loopi = 0; loopi < len; loopi++) {
            strbuf.append((String) handler.get(loopi));
            if (loopi != len - 1)
                strbuf.append(separator);
...
Stringimplode(Vector strings, char delim)
Create a String from the list of strings provided separated by the delimiter.
StringBuffer buf = new StringBuffer();
for (int i = 0; i < strings.size(); i++) {
    buf.append((String) strings.elementAt(i));
    buf.append(delim);
return buf.toString();
voidorderedStringInsert(String key, Vector into)
Insert a String into a vector, maintaing the order.
int lo = 0;
int hi = into.size() - 1;
int idx = -1;
String item = null;
int cmp = 0;
if (hi >= lo) {
    while ((hi - lo) > 1) {
        idx = (hi - lo) / 2 + lo;
...