com.etymon.pjx
Class PdfInteger

java.lang.Object
  extended by com.etymon.pjx.PdfObject
      extended by com.etymon.pjx.PdfNumber
          extended by com.etymon.pjx.PdfInteger
All Implemented Interfaces:
java.lang.Cloneable

public class PdfInteger
extends PdfNumber

Represents the PDF integer object.


Field Summary
protected  int _n
          The int value of this object.
static PdfInteger ZERO
          A PdfInteger object representing the int value 0.
 
Constructor Summary
PdfInteger(int n)
          Constructs an integer object representing an int value.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this instance with another PDF object for equality.
 float getFloat()
          Returns the float value of this number.
 int getInt()
          Returns the int value of this number.
 long getLong()
          Returns the long value of this number.
 int hashCode()
          Returns a hash code for this object.
protected  int writePdf(PdfWriter w, boolean spacing)
          Writes this object in PDF format.
 
Methods inherited from class com.etymon.pjx.PdfObject
clone, filter, filterContents, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_n

protected int _n
The int value of this object.


ZERO

public static final PdfInteger ZERO
A PdfInteger object representing the int value 0.

Constructor Detail

PdfInteger

public PdfInteger(int n)
Constructs an integer object representing an int value.

Parameters:
n - the int value.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Description copied from class: PdfObject
Compares this instance with another PDF object for equality.

Overrides:
equals in class PdfObject
Parameters:
obj - the object to compare this instance with.
Returns:
true if the PDF objects are equal.

getInt

public int getInt()
Description copied from class: PdfNumber
Returns the int value of this number.

Specified by:
getInt in class PdfNumber
Returns:
the int value.

getLong

public long getLong()
Description copied from class: PdfNumber
Returns the long value of this number.

Specified by:
getLong in class PdfNumber
Returns:
the long value.

getFloat

public float getFloat()
Description copied from class: PdfNumber
Returns the float value of this number.

Specified by:
getFloat in class PdfNumber
Returns:
the float value.

hashCode

public int hashCode()
Description copied from class: PdfObject
Returns a hash code for this object.

Overrides:
hashCode in class PdfObject
Returns:
the hash code.

writePdf

protected int writePdf(PdfWriter w,
                       boolean spacing)
                throws java.io.IOException
Description copied from class: PdfObject
Writes this object in PDF format.

Specified by:
writePdf in class PdfObject
Parameters:
w - the PdfWriter to write to.
spacing - specifies whether to add white-space before the object. A value of true enables the addition of white-space. If the object begins with a PDF delimiter, then this option is ignored and no white-space is written.
Returns:
the number of bytes written by this method.
Throws:
java.io.IOException