org.pdfbox.cos
Class COSFloat

java.lang.Object
  extended byorg.pdfbox.cos.COSBase
      extended byorg.pdfbox.cos.COSNumber
          extended byorg.pdfbox.cos.COSFloat
All Implemented Interfaces:
COSObjectable

public class COSFloat
extends COSNumber

This class represents a floating point number in a PDF document.

Version:
$Revision: 1.17 $
Author:
Ben Litchfield

Field Summary
 
Fields inherited from class org.pdfbox.cos.COSNumber
ONE, ZERO
 
Constructor Summary
COSFloat(float aFloat)
          Constructor.
COSFloat(String aFloat)
          Constructor.
 
Method Summary
 Object accept(ICOSVisitor visitor)
          visitor pattern double dispatch method.
 double doubleValue()
          The value of the double object that this one wraps.
 boolean equals(Object o)
          
 float floatValue()
          The value of the float object that this one wraps.
 int hashCode()
          
 int intValue()
          This will get the integer value of this object.
 long longValue()
          This will get the integer value of this object.
 void setValue(float floatValue)
          Set the value of the float object.
 String toString()
          
 void writePDF(OutputStream output)
          This will output this string as a PDF object.
 
Methods inherited from class org.pdfbox.cos.COSNumber
get
 
Methods inherited from class org.pdfbox.cos.COSBase
getCOSObject, getFilterManager
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

COSFloat

public COSFloat(float aFloat)
Constructor.

Parameters:
aFloat - The primitive float object that this object wraps.

COSFloat

public COSFloat(String aFloat)
         throws IOException
Constructor.

Parameters:
aFloat - The primitive float object that this object wraps.
Throws:
IOException - If aFloat is not a float.
Method Detail

setValue

public void setValue(float floatValue)
Set the value of the float object.

Parameters:
floatValue - The new float value.

floatValue

public float floatValue()
The value of the float object that this one wraps.

Specified by:
floatValue in class COSNumber
Returns:
The value of this object.

doubleValue

public double doubleValue()
The value of the double object that this one wraps.

Specified by:
doubleValue in class COSNumber
Returns:
The double of this object.

longValue

public long longValue()
This will get the integer value of this object.

Specified by:
longValue in class COSNumber
Returns:
The int value of this object,

intValue

public int intValue()
This will get the integer value of this object.

Specified by:
intValue in class COSNumber
Returns:
The int value of this object,

equals

public boolean equals(Object o)


hashCode

public int hashCode()


toString

public String toString()


accept

public Object accept(ICOSVisitor visitor)
              throws COSVisitorException
visitor pattern double dispatch method.

Specified by:
accept in class COSBase
Parameters:
visitor - The object to notify when visiting this object.
Returns:
any object, depending on the visitor implementation, or null
Throws:
COSVisitorException - If an error occurs while visiting this object.

writePDF

public void writePDF(OutputStream output)
              throws IOException
This will output this string as a PDF object.

Parameters:
output - The stream to write to.
Throws:
IOException - If there is an error writing to the stream.