com.etymon.pj.object
Class PjReference

java.lang.Object
  extended by com.etymon.pj.object.BaseObject
      extended by com.etymon.pj.object.PjObject
          extended by com.etymon.pj.object.PjReference
All Implemented Interfaces:
java.lang.Cloneable

public class PjReference
extends PjObject

A representation of the PDF reference type.


Field Summary
private  PjNumber _gen
           
private  PjNumber _obj
           
 
Constructor Summary
PjReference(PjNumber obj)
          Creates a PDF reference object.
PjReference(PjNumber obj, PjNumber gen)
          Creates a PDF reference object.
 
Method Summary
 java.lang.Object clone()
          Returns a deep copy of this object.
 boolean equals(java.lang.Object obj)
          Compares two PjReference objects for equality.
 PjNumber getGenNumber()
          Returns the generation number referenced by this PDF reference.
 PjNumber getObjNumber()
          Returns the object number referenced by this PDF reference.
 int hashCode()
          Returns a hash code value for the object.
 long writePdf(java.io.OutputStream os)
          Writes this PDF reference object to a stream in PDF format.
 
Methods inherited from class com.etymon.pj.object.PjObject
renumber
 
Methods inherited from class com.etymon.pj.object.BaseObject
toString, write, write, write, writeln
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_obj

private PjNumber _obj

_gen

private PjNumber _gen
Constructor Detail

PjReference

public PjReference(PjNumber obj)
Creates a PDF reference object.

Parameters:
obj - the object number for the new reference.

PjReference

public PjReference(PjNumber obj,
                   PjNumber gen)
Creates a PDF reference object.

Parameters:
obj - the object number for the new reference.
gen - the generation number for the new reference.
Method Detail

getObjNumber

public PjNumber getObjNumber()
Returns the object number referenced by this PDF reference.

Returns:
the object number within this PDF reference.

getGenNumber

public PjNumber getGenNumber()
Returns the generation number referenced by this PDF reference.

Returns:
the generation number within this PDF reference.

writePdf

public long writePdf(java.io.OutputStream os)
              throws java.io.IOException
Writes this PDF reference object to a stream in PDF format.

Specified by:
writePdf in class BaseObject
Parameters:
os - the stream to write to.
Returns:
the number of bytes written.
Throws:
java.io.IOException - if an I/O error occurs.

clone

public java.lang.Object clone()
Returns a deep copy of this object.

Specified by:
clone in class BaseObject
Returns:
a deep copy of this object.

equals

public boolean equals(java.lang.Object obj)
Compares two PjReference objects for equality.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object to compare to.
Returns:
true if this object is the same as obj, false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode value for this object.