This class represents a floating point number in a PDF document.
Method from org.apache.pdfbox.cos.COSFloat Detail: |
public Object accept(ICOSVisitor visitor) throws COSVisitorException {
return visitor.visitFromFloat(this);
}
visitor pattern double dispatch method. |
public double doubleValue() {
return value;
}
The value of the double object that this one wraps. |
public boolean equals(Object o) {
return o instanceof COSFloat && Float.floatToIntBits(((COSFloat)o).value) == Float.floatToIntBits(value);
}
|
public float floatValue() {
return value;
}
The value of the float object that this one wraps. |
public int hashCode() {
return Float.floatToIntBits(value);
}
|
public int intValue() {
return (int)value;
}
This will get the integer value of this object. |
public long longValue() {
return (long)value;
}
This will get the integer value of this object. |
public void setValue(float floatValue) {
value = floatValue;
}
Set the value of the float object. |
public String toString() {
return "COSFloat{" + value + "}";
}
|
public void writePDF(OutputStream output) throws IOException {
DecimalFormat formatDecimal = (DecimalFormat)NumberFormat.getNumberInstance();
formatDecimal.setMaximumFractionDigits( 10 );
formatDecimal.setGroupingUsed( false );
DecimalFormatSymbols symbols = formatDecimal.getDecimalFormatSymbols();
symbols.setDecimalSeparator( '.' );
formatDecimal.setDecimalFormatSymbols( symbols );
output.write(formatDecimal.format( value ).getBytes());
}
This will output this string as a PDF object. |