|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.text.Format
com.twelvemonkeys.util.TimeFormat
public class TimeFormat
Format for converting and parsing time.
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| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.text.Format |
|---|
Format.Field |
| Field Summary | |
|---|---|
protected String |
formatString
|
protected com.twelvemonkeys.util.TimeFormatter[] |
formatter
The formatter array. |
| Constructor Summary | |
|---|---|
TimeFormat(String pStr)
Creates a new TimeFormat with the given formatString, |
|
| Method Summary | |
|---|---|
StringBuffer |
format(Object pObj,
StringBuffer pToAppendTo,
FieldPosition pPos)
DUMMY IMPLEMENTATION!! |
String |
format(Time pTime)
Formats the the given time, using this format. |
String |
getFormatString()
Gets the format string. |
static TimeFormat |
getInstance()
DUMMY IMPLEMENTATION!! Not locale specific. |
Time |
parse(String pStr)
Parses a Time, according to this format. |
Object |
parseObject(String pStr,
ParsePosition pStatus)
DUMMY IMPLEMENTATION!! |
| Methods inherited from class java.text.Format |
|---|
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String formatString
protected com.twelvemonkeys.util.TimeFormatter[] formatter
| Constructor Detail |
|---|
public TimeFormat(String pStr)
| Method Detail |
|---|
public static TimeFormat getInstance()
public String getFormatString()
public StringBuffer format(Object pObj,
StringBuffer pToAppendTo,
FieldPosition pPos)
format in class Formatpublic String format(Time pTime)
public Object parseObject(String pStr,
ParsePosition pStatus)
parseObject in class Formatpublic Time parse(String pStr)
Will bug on some formats. It's safest to always use delimiters between the minutes (m) and seconds (s) part.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||