Class COSFloat

  • All Implemented Interfaces:
    COSObjectable

    public final class COSFloat
    extends COSNumber
    A PDF real number object, e.g. 3.14, -0.001. PDF real numbers are stored/rendered with BigDecimal internally so that round-tripping a value read from a file does not introduce binary floating point noise (a common source of subtly-corrupt PDF output).
    • Constructor Detail

      • COSFloat

        public COSFloat​(float value)
      • COSFloat

        public COSFloat​(double value)
      • COSFloat

        public COSFloat​(java.lang.String token)
                 throws COSException
        Parses a PDF real-number token. Tolerates a handful of malformed variants seen in the wild: a lone "." or "-", multiple leading signs, and a trailing/leading "." with no digits on one side.
        Throws:
        COSException
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object