talx.util
Class FeatureDescriptor
java.lang.Object
talx.util.FeatureDescriptor
- All Implemented Interfaces:
- java.io.Serializable
- public class FeatureDescriptor
- extends java.lang.Object
- implements java.io.Serializable
class to hold feature name and param string.
Also provides static parse methods to help with param
string parsing.
- See Also:
- Serialized Form
|
Method Summary |
java.lang.String |
getName()
|
java.lang.String |
getParam()
|
static StringValueMap |
splitPairs(java.lang.String s)
Splits the given string into name=value pairs. |
static java.awt.Color |
stringToColor(java.lang.String name)
Returns the color constant with the given name. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FeatureDescriptor
public FeatureDescriptor(java.lang.String name,
java.lang.String param)
getName
public java.lang.String getName()
getParam
public java.lang.String getParam()
stringToColor
public static java.awt.Color stringToColor(java.lang.String name)
- Returns the color constant with the given name. The match is not
case sensitive, so "LightGray", "LIGHTGRAY", and "light_gray" all
return the color constant referred to as Color.LightGray or
Color.LIGHT_GRAY. If no matching color constant could be found, this
method returns null.
splitPairs
public static StringValueMap splitPairs(java.lang.String s)
- Splits the given string into name=value pairs.
The returned map associates key strings with string, Integer or int[] values.
The input string is expected to be a white-space-delimited list
of name=value pairs with no space within the name. If the value
contains space, then it is expected to be enclosed in double quotes.
if the value can be interpreted as an int, it will be stored in the
map as an Integer object. If the value is enclosed in square brackets,
and consists entirely of comma and white-space-delimited integer values,
it is stored as an int array. Otherwise, it is returned as a string.
Any tokens that are found that do not contain an equals sign are returned
as a concatenated, space-delimited string using the empty string as the key.
All names are converted to lower case.
toString
public java.lang.String toString()
© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.