org.pdfbox.cos
Class COSInteger

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

public class COSInteger
extends COSNumber

This class represents an integer number in a PDF document.

Version:
$Revision: 1.12 $
Author:
Ben Litchfield

Field Summary
 
Fields inherited from class org.pdfbox.cos.COSNumber
ONE, ZERO
 
Constructor Summary
COSInteger(int val)
          constructor.
COSInteger(long val)
          constructor.
COSInteger(String val)
          This will create a new PDF Int object using a string.
 
Method Summary
 Object accept(ICOSVisitor visitor)
          visitor pattern double dispatch method.
 double doubleValue()
          polymorphic access to value as float.
 boolean equals(Object o)
          
 float floatValue()
          polymorphic access to value as float.
 int hashCode()
          
 int intValue()
          Polymorphic access to value as int This will get the integer value of this object.
 long longValue()
          Polymorphic access to value as int This will get the integer value of this object.
 void setValue(long newValue)
          Change the value of this reference.
 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

COSInteger

public COSInteger(long val)
constructor.

Parameters:
val - The integer value of this object.

COSInteger

public COSInteger(int val)
constructor.

Parameters:
val - The integer value of this object.

COSInteger

public COSInteger(String val)
           throws IOException
This will create a new PDF Int object using a string.

Parameters:
val - The string value of the integer.
Throws:
IOException - If the val is not an integer type.
Method Detail

equals

public boolean equals(Object o)


hashCode

public int hashCode()


toString

public String toString()


setValue

public void setValue(long newValue)
Change the value of this reference.

Parameters:
newValue - The new value.

floatValue

public float floatValue()
polymorphic access to value as float.

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

doubleValue

public double doubleValue()
polymorphic access to value as float.

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

intValue

public int intValue()
Polymorphic access to value as int This will get the integer value of this object.

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

longValue

public long longValue()
Polymorphic access to value as int This will get the integer value of this object.

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

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.