java.lang.Object
io.sf.jclf.text.format.ObjectFormat
io.sf.jclf.text.format.NumberFormat
- All Implemented Interfaces:
Alignable
- Direct Known Subclasses:
FloatFormat
,HexFormat
,IntegerFormat
,OctalFormat
Abstract class for Number-realted object formats.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected char
protected boolean
Fields inherited from class io.sf.jclf.text.format.ObjectFormat
flags, precision, ralign, width
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected long
protected final String
roundNumber
(Number num) protected boolean
setFlag
(char flag, int i) Sets the flags specific to this Class.protected char
Sets the format of the object.Methods inherited from class io.sf.jclf.text.format.ObjectFormat
align, create, create, create, expandLeftToWidth, expandRightToWidth, format, getAlignment, rightAppend, sample, setFlags
-
Field Details
-
tipo
protected char tipo -
signpre
protected boolean signpre -
blankpre
protected boolean blankpre -
zeropadding
protected boolean zeropadding
-
-
Constructor Details
-
NumberFormat
protected NumberFormat()
-
-
Method Details
-
setFormat
Description copied from class:ObjectFormat
Sets the format of the object.- Overrides:
setFormat
in 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:ObjectFormat
Sets the flags specific to this Class.- Overrides:
setFlag
in classObjectFormat
- Parameters:
flag
- the flagi
- the position of the flag in the flags String- Returns:
true
if the flag was understood,false
otherwise.
-
getRoundingFactor
protected long getRoundingFactor() -
roundNumber
-