com.etymon.pj.object
Class PjString

java.lang.Object
  |
  +--com.etymon.pj.object.BaseObject
        |
        +--com.etymon.pj.object.PjObject
              |
              +--com.etymon.pj.object.PjString
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
PjDate

public class PjString
extends PjObject

A representation of the PDF string type.


Constructor Summary
PjString(java.lang.String s)
          Creates a string object.
 
Method Summary
 java.lang.Object clone()
          Returns a deep copy of this object.
static java.lang.String decodePdf(java.lang.String pdfString)
          Converts a PDF-encoded string to a java String, which may be then be used to initialize a PjString object.
 boolean equals(java.lang.Object obj)
          Compares two PjString objects for equality.
 java.lang.String getString()
          Returns the string value of this object.
 long writePdf(java.io.OutputStream os)
          Writes this string 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, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PjString

public PjString(java.lang.String s)
Creates a string object.
Parameters:
s - the string value to initialize this object to.
Method Detail

getString

public java.lang.String getString()
Returns the string value of this object.
Returns:
the string value of this object.

writePdf

public long writePdf(java.io.OutputStream os)
              throws java.io.IOException
Writes this string to a stream in PDF format.
Overrides:
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.
Overrides:
clone in class BaseObject
Returns:
a deep copy of this object.

decodePdf

public static java.lang.String decodePdf(java.lang.String pdfString)
                                  throws PdfFormatException
Converts a PDF-encoded string to a java String, which may be then be used to initialize a PjString object.
Parameters:
pdfString - the PDF-encoded string to be decoded.
Returns:
the sequence of characters decoded from pdfString, represented as a java String.
Throws:
PdfFormatException - if pdfString is invalid PDF.

equals

public boolean equals(java.lang.Object obj)
Compares two PjString 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.