org.apache.pdfbox.cos
public class: COSBoolean [javadoc |
source]
java.lang.Object
org.apache.pdfbox.cos.COSBase
org.apache.pdfbox.cos.COSBoolean
All Implemented Interfaces:
COSObjectable
This class represents a boolean value in the PDF document.
Field Summary |
---|
public static final byte[] | TRUE_BYTES | The true boolean token. |
public static final byte[] | FALSE_BYTES | The false boolean token. |
public static final COSBoolean | TRUE | The PDF true value. |
public static final COSBoolean | FALSE | The PDF false value. |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.pdfbox.cos.COSBoolean Detail: |
public Object accept(ICOSVisitor visitor) throws COSVisitorException {
return visitor.visitFromBoolean(this);
}
visitor pattern double dispatch method. |
public static COSBoolean getBoolean(boolean value) {
return (value?TRUE:FALSE);
}
This will get the boolean value. |
public static COSBoolean getBoolean(Boolean value) {
return getBoolean( value.booleanValue() );
}
This will get the boolean value. |
public boolean getValue() {
return value;
}
This will get the value that this object wraps. |
public Boolean getValueAsObject() {
return (value?Boolean.TRUE:Boolean.FALSE);
}
This will get the value that this object wraps. |
public String toString() {
return String.valueOf( value );
}
Return a string representation of this object. |
public void writePDF(OutputStream output) throws IOException {
if( value )
{
output.write( TRUE_BYTES );
}
else
{
output.write( FALSE_BYTES );
}
}
This will write this object out to a PDF stream. |