public class VString extends Vector<String>
Modifier and Type | Field and Description |
---|---|
static VString |
emptyVector
the empty VString
|
capacityIncrement, elementCount, elementData
modCount
Constructor and Description |
---|
VString()
constructor
|
VString(Enumeration<String> a)
creates a VString from an Enumeration of Strings
|
VString(String strIn)
Deprecated.
use VString (String strIn, null)
|
VString(String[] a)
creates a VString from an array of Strings
|
VString(String strIn,
String strSep)
constructs a VString by tokenizing a string
|
VString(Vector<String> m)
constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(org.apache.commons.lang.enums.ValuedEnum enumType)
appends enumType to
this if enumType is a ValuedEnum, the name is appended |
void |
addAll(String[] strings)
appends all strings of an array to
this |
void |
appendUnique(String string)
AppendUnique - append a string but ignore multiple entries
|
void |
appendUnique(VString v)
AppendUnique - append a vector but ignore multiple entries
|
boolean |
containsAny(VString others)
checks whether at least one of a given vector of strings is contained in
this |
String |
elementAt(int index) |
String |
get(int index) |
String |
get(String s)
get a string from
this |
String |
getAllStrings()
Deprecated.
use getString(JDFConstants.BLANK,null,null)
|
String |
getAllStrings(String strSep)
Deprecated.
use getString(strSep,null,null)
|
VString |
getOverlapping(VString others)
vector of strings that is contained in
this |
Set<String> |
getSet()
gets a set with all entries of the VString
note that the set retains ordering (LinkedHashSet) |
String |
getString(String sep,
String front,
String back)
Deprecated.
use StringUtil setVString default: getString(sep, JDFConstants.EMPTYSTRING, JDFConstants.EMPTYSTRING)
|
static VString |
getVString(String strIn,
String strSep)
simple static factory - null if strIn is null or empty
|
boolean |
hasString(String s)
Deprecated.
2005-02-14 use contains ...
|
int |
index(String s)
index - get the index of s in the vector
|
String |
remove(int index)
remove but also implementing the usual neg number syntax
|
void |
removeStrings(String s)
Deprecated.
use removeStrings(s, Integer.MAX_VALUE);
|
void |
removeStrings(String s,
int nMax)
removeStrings - remove nMax occurrences of a string
|
void |
removeStrings(VString v)
Deprecated.
use removeStrings(v, Integer.MAX_VALUE);
|
void |
removeStrings(VString v,
int nMax)
removeStrings - remove all occurrences of a string
|
void |
setAllStrings(String strIn,
String strSep)
Method setAllStrings - put a separated string into the vString
e.g. |
String |
setvString(VString v,
String sep,
String front,
String end)
Deprecated.
use getString
|
void |
sort()
sort
this lexically |
String |
stringAt(int index)
Deprecated.
- simply use get
|
String |
toString()
toString
|
void |
unify()
unify - make VString unique, retaining initial order
|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elements, ensureCapacity, equals, firstElement, forEach, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, trimToSize
finalize, getClass, notify, notifyAll, wait, wait, wait
parallelStream, stream
public static final VString emptyVector
public VString()
@Deprecated public VString(String strIn)
strIn
- the string to tokenize by blankpublic VString(String strIn, String strSep)
strIn
- the string to tokenizestrSep
- the separator characterpublic VString(String[] a)
a
- the arraypublic VString(Enumeration<String> a)
a
- the Enumerationpublic static VString getVString(String strIn, String strSep)
strIn
- strSep
- @Deprecated public String stringAt(int index)
index
- the index which may be negative to count backwardspublic String elementAt(int index)
public String get(int index)
public String toString()
@Deprecated public String getAllStrings(String strSep)
strSep
- separation between the strings@Deprecated public String getAllStrings()
public void setAllStrings(String strIn, String strSep)
strIn
- separated stringstrSep
- string separatorpublic int index(String s)
s
- @Deprecated public boolean hasString(String s)
this
?s
- string to findthis
public void appendUnique(String string)
string
- the string to append, if null nothing is addedpublic void appendUnique(VString v)
v
- the vector to append, if null nothing is added@Deprecated public void removeStrings(VString v)
v
- public void removeStrings(VString v, int nMax)
v
- the vector of strings to remove from this
nMax
- the max number of strings to remove@Deprecated public void removeStrings(String s)
s
- public void removeStrings(String s, int nMax)
s
- the string to removenMax
- remove s max. nMax times , 0 or negative = infinite@Deprecated public String getString(String sep, String front, String back)
sep
- separator between stringsfront
- string before the first entryback
- string after the last entry@Deprecated public String setvString(VString v, String sep, String front, String end)
v
- vector of tokenssep
- separator between tokensfront
- prefix to string (before the first token)end
- suffix to string (after the last token)public void unify()
public String get(String s)
this
s
- the String you are looking forthis
does not contain spublic Set<String> getSet()
public void sort()
this
lexicallypublic void addAll(String[] strings)
this
strings
- the array of strings to append to this
public boolean containsAny(VString others)
this
others
- the VSTring of values to testthis
public VString getOverlapping(VString others)
this
others
- the VString of values to testthis
public boolean add(org.apache.commons.lang.enums.ValuedEnum enumType)
this
enumType
- the object to appendCopyright © 2018. All rights reserved.