public class TimeFormat
extends java.text.Format
The format is expressed in a string as follows:
May not handle all cases, and formats... ;-) Safest is: Always delimiters between the minutes (m) and seconds (s) part.
TODO: Move to com.twelvemonkeys.text? Milliseconds! Fix bugs. Known bugs:
The last character in the formatString is not escaped, while it should be. The first character after an escaped character is escaped while is shouldn't be.
This is not a 100% compatible implementation of a java.text.Format.
Time,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
formatString |
protected com.twelvemonkeys.util.TimeFormatter[] |
formatter
The formatter array.
|
| Constructor and Description |
|---|
TimeFormat(java.lang.String pStr)
Creates a new TimeFormat with the given formatString,
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.StringBuffer |
format(java.lang.Object pObj,
java.lang.StringBuffer pToAppendTo,
java.text.FieldPosition pPos)
DUMMY IMPLEMENTATION!!
|
java.lang.String |
format(Time pTime)
Formats the the given time, using this format.
|
java.lang.String |
getFormatString()
Gets the format string.
|
static TimeFormat |
getInstance()
DUMMY IMPLEMENTATION!!
Not locale specific.
|
Time |
parse(java.lang.String pStr)
Parses a Time, according to this format.
|
java.lang.Object |
parseObject(java.lang.String pStr,
java.text.ParsePosition pStatus)
DUMMY IMPLEMENTATION!!
|
protected java.lang.String formatString
protected com.twelvemonkeys.util.TimeFormatter[] formatter
public TimeFormat(java.lang.String pStr)
public static TimeFormat getInstance()
public java.lang.String getFormatString()
public java.lang.StringBuffer format(java.lang.Object pObj,
java.lang.StringBuffer pToAppendTo,
java.text.FieldPosition pPos)
format in class java.text.Formatpublic java.lang.String format(Time pTime)
public java.lang.Object parseObject(java.lang.String pStr,
java.text.ParsePosition pStatus)
parseObject in class java.text.Formatpublic Time parse(java.lang.String pStr)
Will bug on some formats. It's safest to always use delimiters between the minutes (m) and seconds (s) part.
Copyright © 2018. All Rights Reserved.