|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.text.Format
net.sf.japaki.text.AbstractFormat
public abstract class AbstractFormat
This class provides a skeletal implementation of the Format class, to minimize the effort required to implement a format.
Nested Class Summary | |
---|---|
protected static class |
AbstractFormat.DefaultField
Miminal implementation of the Field class. |
Nested classes/interfaces inherited from class java.text.Format |
---|
Format.Field |
Constructor Summary | |
---|---|
AbstractFormat()
|
Method Summary | |
---|---|
static void |
appendAndSetIndexes(StringBuffer toAppendTo,
String text,
Format.Field field,
FieldPosition pos)
Appends the given text to the buffer. |
StringBuffer |
format(Object obj,
StringBuffer toAppendTo,
FieldPosition pos)
Appends the Object.toString() representation of the object
to the buffer. |
Format.Field |
getField()
Returns the field used by this format. |
void |
setField(Format.Field field)
Sets the field used by this format. |
Methods inherited from class java.text.Format |
---|
clone, format, formatToCharacterIterator, parseObject, parseObject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractFormat()
Method Detail |
---|
public Format.Field getField()
public void setField(Format.Field field)
field
- the field to be compared in format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition)
used by this format.public static void appendAndSetIndexes(StringBuffer toAppendTo, String text, Format.Field field, FieldPosition pos)
toAppendTo
- where the text is to be appendedtext
- newly formatted text for this fieldfield
- field to check aganinst the field in pos
pos
- field position to be updated
NullPointerException
- if toAppendTo
or
pos
or field
is null
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
Object.toString()
representation of the object
to the buffer.
format
in class Format
obj
- the object to formattoAppendTo
- where the text is to be appendedpos
- ignored
toAppendTo
,
with formatted text appended
NullPointerException
- if obj
is null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |