edu.berkeley.guir.lib.util
Class ParserLib
java.lang.Object
|
+--edu.berkeley.guir.lib.util.ParserLib
- public final class ParserLib
- extends Object
Simple parsing.
This software is distributed under the
Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Apr 19 1997, JH
Created class
- GUIRLib-v1.2-1.0.0, Jun 22 2000, JH
Touched for GUIRLib release
- GUIRLib-v1.3-1.0.0, Aug 11 2000, JH
Touched for GUIRLib release
- GUIRLib-v1.4-1.0.0, Aug 31 2000, JH
Touched for GUIRLib release
- Since:
- 1.2
- Version:
- GUIRLib-v1.4-1.0.0, Aug 31 2000
- Author:
- Jason Hong (
jasonh@cs.berkeley.edu)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DELIMITERS
public static final String DELIMITERS
ParserLib
public ParserLib()
parseIntArray
public static final int[] parseIntArray(String str)
throws ParseException
- Parameters:
str
- looks like "1, 2, 3, 5" or "0,7,18,"- Returns:
- an array of ints.
- Throws:
ParseException
- if there was a parsing error.
parseFloatArray
public static final float[] parseFloatArray(String str)
throws ParseException
- Parameters:
str
- looks like "1.0, 2.0, 3.0, 2.5" or "2.0, 2.718,"- Returns:
- an array of floats.
- Throws:
ParseException
- if there was a parsing error.
parseColor
public static final Color parseColor(String str)
throws ParseException
- Parameters:
str
- is either one of the color constants defined in
java.awt.Color, or a 3 or 4-tuple of ints specifying rgba.- Returns:
- a Color object if the color was known.
- Throws:
ParseException
- if there was a parsing error.
main
public static void main(String[] argv)
throws Exception