prefuse.data.parser
Class JavaDateParser
java.lang.Object
prefuse.data.parser.AbstractDateParser
prefuse.data.parser.JavaDateParser
- All Implemented Interfaces:
- DataParser
public class JavaDateParser
- extends AbstractDateParser
DataParser instance that parses Date values as java.util.Date instances,
representing a particular date and time.
This class uses a backing DateFormat
instance to
perform parsing. The DateFormat instance to use can be passed in to the
constructor, or by default the DateFormat returned by
DateFormat.getDateTimeInstance(int, int)
with both
arguments being DateFormat.SHORT
is used.
- Author:
- jeffrey heer
Method Summary |
java.lang.Class<?> |
getType()
Get the data type for the values parsed by this parser. |
java.util.Date |
parseDate(java.lang.String text)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaDateParser
public JavaDateParser()
- Create a new DateTimeParser.
JavaDateParser
public JavaDateParser(java.text.DateFormat dateFormat)
- Create a new DateTimeParser.
- Parameters:
dateFormat
- the DateFormat instance to use for parsing
JavaDateParser
public JavaDateParser(java.util.Locale locale)
getType
public java.lang.Class<?> getType()
- Description copied from interface:
DataParser
- Get the data type for the values parsed by this parser.
- Specified by:
getType
in interface DataParser
- Specified by:
getType
in class AbstractDateParser
- Returns:
- the parsed data type for this parser as a Java Class instance
parseDate
public java.util.Date parseDate(java.lang.String text)
throws DataParseException
- Specified by:
parseDate
in class AbstractDateParser
- Throws:
DataParseException
Copyright © 2008 Regents of the University of California