Package com.pd4ml.pdf.cos
Class COSFloat
- java.lang.Object
-
- com.pd4ml.pdf.cos.COSBase
-
- com.pd4ml.pdf.cos.COSNumber
-
- com.pd4ml.pdf.cos.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 withBigDecimalinternally 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).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(ICOSVisitor<T> visitor)doubledoubleValue()booleanequals(java.lang.Object other)floatfloatValue()inthashCode()intintValue()longlongValue()java.lang.StringtoString()-
Methods inherited from class com.pd4ml.pdf.cos.COSBase
getCOSObject, getGenerationNumber, getKey, getObjectNumber, isDirect, resolve, setKey
-
-
-
-
Constructor Detail
-
COSFloat
public COSFloat(float value)
-
COSFloat
public COSFloat(double value)
-
COSFloat
public COSFloat(java.lang.String token) throws COSExceptionParses 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
-
floatValue
public float floatValue()
- Specified by:
floatValuein classCOSNumber
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classCOSNumber
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
accept
public <T> T accept(ICOSVisitor<T> visitor) throws COSException
- Specified by:
acceptin classCOSBase- Throws:
COSException
-
-