java.lang.Object
io.sf.jclf.text.format.ObjectFormat
io.sf.jclf.text.format.TextFormat
- All Implemented Interfaces:
Alignable
Formats text.
-
Field Summary
Fields inherited from class io.sf.jclf.text.format.ObjectFormat
flags, precision, ralign, width -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.sf.jclf.text.format.ObjectFormat
align, create, create, create, expandLeftToWidth, expandRightToWidth, getAlignment, rightAppend, setFlags
-
Constructor Details
-
TextFormat
public TextFormat()
-
-
Method Details
-
setFormat
Description copied from class:ObjectFormatSets the format of the object.- Overrides:
setFormatin classObjectFormat- Parameters:
format- the format.- Returns:
- the format type
- Throws:
SpecParsingException- if the format contains unknown or wrong format specs.
-
setFlag
protected boolean setFlag(char flag, int i) Description copied from class:ObjectFormatSets the flags specific to this Class.- Overrides:
setFlagin classObjectFormat- Parameters:
flag- the flagi- the position of the flag in the flags String- Returns:
trueif the flag was understood,falseotherwise.
-
format
Description copied from class:ObjectFormatFormats an object according to the format specification set bysetFormat.Must be overriden by subclasses.
- Specified by:
formatin classObjectFormat- Parameters:
o- the object to be formatted.- Returns:
- a string with the formatted object.
-
sample
Description copied from class:ObjectFormatProduce a sample of this format.- Specified by:
samplein classObjectFormat- Returns:
- a String with a (more or less) random object appropriate to be formatted according to current format specifications.
-