com.etymon.pjx
Class PdfNull

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

public class PdfNull
extends PdfObject

Represents the PDF null object.


Field Summary
static PdfNull NULL
          A PdfNull object representing the null value.
 
Constructor Summary
PdfNull()
          Constructs a null object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this instance with another PDF object for equality.
 int hashCode()
          Returns a hash code for this object.
static boolean isNull(java.lang.Object obj)
          Checks whether an object represents a null value.
static PdfNull valueOf()
          Returns a PdfNull 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

NULL

public static final PdfNull NULL
A PdfNull object representing the null value.

Constructor Detail

PdfNull

public PdfNull()
Constructs a null object. In most cases there is no need to create a new instance of this class, and the valueOf() method is preferred.

Method Detail

isNull

public static boolean isNull(java.lang.Object obj)
Checks whether an object represents a null value. Note that this method differs slightly from equals(Object) in that this returns true when called with a null value. This method is useful for examining PDF objects, in which null and PdfNull should normally be considered equivalent. For example, if a dictionary value or an indirect object is PdfNull, it is equivalent to the object not existing.

Parameters:
obj - the object to examine.
Returns:
true if the object is either null or an instance of PdfNull; otherwise false is returned.

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.

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.

valueOf

public static PdfNull valueOf()
Returns a PdfNull object. This method is normally preferable to PdfNull() because it avoids allocating a new instance.

Returns:
the null object.

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