public class StringTagger extends Object implements Map
| Constructor and Description |
|---|
StringTagger(String line)
Creates a StringTag for the given line.
|
StringTagger(String line,
char tagStart,
char tagSeparator,
char fieldSeparator,
char quote)
Creates a StringTag for the given line.
|
StringTagger(String line,
char tagStart,
char tagSeparator,
char fieldSeparator,
char quote,
char functionOpen,
char functionClose)
Creates a StringTag for the given line.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all data
|
boolean |
containsKey(Object ob)
Checks whether a key exits.
|
boolean |
containsValue(Object ob)
Checks whether a value exits.
|
protected void |
createTagger(String line)
Parses the given line, and stores all value-pairs found in the
tokens and multitokens fields.
|
Enumeration |
elements()
Returns a Enumeration of the values as String.
|
Set |
entrySet()
returns all values
|
boolean |
equals(Object ob)
Returns whether two objects are the same
|
Object |
get(Object ob)
Returns the value of a key as an Object.
|
int |
hashCode()
Hashcode for sorting and comparing
|
boolean |
isEmpty()
Checks whether the tagger is empty
|
Enumeration |
keys()
Returns a Enumeration of the name keys.
|
Set |
keySet()
Returns a Set of the name keys.
|
static void |
main(String[] args)
For testing
|
Enumeration |
multiElements(String token)
Returns a Enumeration of the values as Vectors that contain
the seperated values.
|
Object |
put(Object key,
Object value)
sets a value (for the Map interface).
|
void |
putAll(Map map)
Manually sets a set of values (for the Map interface).
|
Object |
remove(Object key)
remove a value (for the Map interface).
|
void |
setValue(String token,
String val)
Manually sets a single value.
|
void |
setValues(String token,
Vector values)
Manually sets a multi-value value.
|
int |
size()
sets a value (for the Map interface).
|
protected void |
splitTag(String tag)
Handles and splits a tag in its component parts, and store the elemements in
the tokens and multitokens fields.
|
String |
toString()
toString
|
String |
Value(String token)
Returns the first value as a
String. |
Collection |
values()
returns all values
|
Vector |
Values(String token)
Returns the values as a Vector that contains the separated values.
|
String |
ValuesString(String token)
Returns the original parsed line
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic StringTagger(String line, char tagStart, char tagSeparator, char fieldSeparator, char quote, char functionOpen, char functionClose)
line - : to be tagged linetagStart - : Seperator for the TagstagSeparator - : Seperator inside the Tag (between name and value)fieldSeparator - : Seperator inside the valuequote - : Char used if a quoted valuefunctionOpen - char used to open a function parameter listfunctionClose - char used to close a function parameter listpublic StringTagger(String line, char tagStart, char tagSeparator, char fieldSeparator, char quote)
line - : to be tagged linetagStart - : Seperator for the TagstagSeparator - : Seperator inside the Tag (between name and value)fieldSeparator - : Seperator inside the valuequote - : Char used if a quoted valuepublic StringTagger(String line)
line - : to be tagged lineprotected void createTagger(String line)
line - : to be tagged line (why is this a parameter when it can eb retrieved from startline?)protected void splitTag(String tag)
tag - the string containing the tagpublic boolean containsKey(Object ob)
containsKey in interface Mappublic boolean containsValue(Object ob)
containsValue in interface Mappublic boolean equals(Object ob)
public Object get(Object ob)
Values(java.lang.String) to get a list of multi-values as a Vector.Value(java.lang.String) to get the first value as a Stringpublic int hashCode()
public boolean isEmpty()
public void putAll(Map map)
public Collection values()
public Enumeration keys()
public Enumeration elements()
multiElements(java.lang.String) to get a list of multi-values.public Enumeration multiElements(String token)
elements() to get a list of single, unseparated, values.public Vector Values(String token)
get(java.lang.Object) to get the list of values as a StringValue(java.lang.String) to get the first value as a Stringtoken - the key of the value to retrievepublic String ValuesString(String token)
token - unusedpublic String Value(String token)
String.
In case of a single value, it returns that value. In case of multiple values,
it returns the
Use get(java.lang.Object) to get the list of values as a StringValues(java.lang.String) to get a list of multi-values as a Vector.token - the key of the value to retrievepublic static void main(String[] args)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}