|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.graphstream.util.time.ISODateIO
public class ISODateIO
Scanner for date in ISO/IEC 9899:1999 format. The scanner takes a format and
then is able to parse timestamp in the given format.
The parse() return a Calendar
for convenience.
Format of the scanner can be composed of %? directive which define components
of the time. These directives are listed below. For example, the format
"%F %T", which is equivalent to "%Y-%m-%d %H:%M:%S" can parse the following
timestamp: "2010-12-09 03:45:39";
Constructor Summary | |
---|---|
ISODateIO()
Create a scanner with default format "%K". |
|
ISODateIO(String format)
Create a new scanner with a given format. |
Method Summary | |
---|---|
Pattern |
getPattern()
Get the current pattern used to parse timestamp. |
Calendar |
parse(String time)
Parse a string which should be in the scanner format. |
void |
setFormat(String format)
Set the format of this scanner. |
String |
toString(Calendar calendar)
Convert a calendar into a string according to the format of this object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ISODateIO() throws ParseException
ParseException
public ISODateIO(String format) throws ParseException
format
- format of the scanner.
ParseException
- if bad directives foundMethod Detail |
---|
public Pattern getPattern()
public void setFormat(String format) throws ParseException
format
- new format of the scanner
ParseException
- if an error is found in the new formatpublic Calendar parse(String time)
time
- timestamp in the scanner format
public String toString(Calendar calendar)
calendar
- the calendar to convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |