Class NumberFormat

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

public abstract class NumberFormat extends ObjectFormat
Abstract class for Number-realted object formats.
  • 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

      protected char setFormat(String format) throws SpecParsingException
      Description copied from class: ObjectFormat
      Sets the format of the object.
      Overrides:
      setFormat in class ObjectFormat
      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 class ObjectFormat
      Parameters:
      flag - the flag
      i - the position of the flag in the flags String
      Returns:
      true if the flag was understood, false otherwise.
    • getRoundingFactor

      protected long getRoundingFactor()
    • roundNumber

      protected final String roundNumber(Number num)