com.etymon.pjx
Class PdfString

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

public class PdfString
extends PdfObject

Represents the PDF string object.


Field Summary
protected  java.lang.String _s
          The string value of this PDF string object.
 
Constructor Summary
PdfString(java.lang.String s)
          Constructs a PDF string object representing a string value.
 
Method Summary
protected static java.lang.String decodeHexString(java.nio.CharBuffer buf)
           
protected static java.lang.String decodeLiteralString(java.nio.CharBuffer buf)
           
 boolean equals(java.lang.Object obj)
          Compares this instance with another PDF object for equality.
 java.lang.String getString()
          Returns the string value of this PDF string object.
 int hashCode()
          Returns a hash code for this object.
protected static boolean isWhiteSpace(char ch)
          Determines whether a character is a white-space character.
protected static java.lang.String pdfToString(java.nio.CharBuffer buf)
          Converts a PDF string object in PDF format to a string value as stored by this class.
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

_s

protected java.lang.String _s
The string value of this PDF string object.

Constructor Detail

PdfString

public PdfString(java.lang.String s)
Constructs a PDF string object representing a string value.

Parameters:
s - the string 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.

getString

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

Returns:
the string 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.

isWhiteSpace

protected static boolean isWhiteSpace(char ch)
Determines whether a character is a white-space character.

Parameters:
ch - the character to examine.
Returns:
true if the character is a white-space character.

pdfToString

protected static java.lang.String pdfToString(java.nio.CharBuffer buf)
                                       throws PdfFormatException
Converts a PDF string object in PDF format to a string value as stored by this class.

Parameters:
buf - contains the PDF string object in PDF format.
Throws:
PdfFormatException

decodeLiteralString

protected static java.lang.String decodeLiteralString(java.nio.CharBuffer buf)
                                               throws java.nio.BufferUnderflowException,
                                                      PdfFormatException
Throws:
java.nio.BufferUnderflowException
PdfFormatException

decodeHexString

protected static java.lang.String decodeHexString(java.nio.CharBuffer buf)
                                           throws java.nio.BufferUnderflowException,
                                                  PdfFormatException
Throws:
java.nio.BufferUnderflowException
PdfFormatException

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