Package org.apache.pdfbox.cos
Class COSBoolean
- java.lang.Object
-
- org.apache.pdfbox.cos.COSBase
-
- org.apache.pdfbox.cos.COSBoolean
-
- All Implemented Interfaces:
COSObjectable
public final class COSBoolean extends COSBase
This class represents a boolean value in the PDF document.
-
-
Field Summary
Fields Modifier and Type Field Description static COSBooleanFALSEThe PDF false value.private static byte[]FALSE_BYTESThe false boolean token.static COSBooleanTRUEThe PDF true value.private static byte[]TRUE_BYTESThe true boolean token.private booleanvalue
-
Constructor Summary
Constructors Modifier Constructor Description privateCOSBoolean(boolean aValue)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ICOSVisitor visitor)visitor pattern double dispatch method.booleanequals(java.lang.Object obj)static COSBooleangetBoolean(boolean value)This will get the boolean value.static COSBooleangetBoolean(java.lang.Boolean value)This will get the boolean value.booleangetValue()This will get the value that this object wraps.java.lang.BooleangetValueAsObject()This will get the value that this object wraps.inthashCode()java.lang.StringtoString()Return a string representation of this object.voidwritePDF(java.io.OutputStream output)This will write this object out to a PDF stream.
-
-
-
Field Detail
-
TRUE_BYTES
private static final byte[] TRUE_BYTES
The true boolean token.
-
FALSE_BYTES
private static final byte[] FALSE_BYTES
The false boolean token.
-
TRUE
public static final COSBoolean TRUE
The PDF true value.
-
FALSE
public static final COSBoolean FALSE
The PDF false value.
-
value
private final boolean value
-
-
Method Detail
-
getValue
public boolean getValue()
This will get the value that this object wraps.- Returns:
- The boolean value of this object.
-
getValueAsObject
public java.lang.Boolean getValueAsObject()
This will get the value that this object wraps.- Returns:
- The boolean value of this object.
-
getBoolean
public static COSBoolean getBoolean(boolean value)
This will get the boolean value.- Parameters:
value- Parameter telling which boolean value to get.- Returns:
- The single boolean instance that matches the parameter.
-
getBoolean
public static COSBoolean getBoolean(java.lang.Boolean value)
This will get the boolean value.- Parameters:
value- Parameter telling which boolean value to get.- Returns:
- The single boolean instance that matches the parameter.
-
accept
public void accept(ICOSVisitor visitor) throws java.io.IOException
visitor pattern double dispatch method.
-
toString
public java.lang.String toString()
Return a string representation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string value of this object.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
writePDF
public void writePDF(java.io.OutputStream output) throws java.io.IOExceptionThis will write this object out to a PDF stream.- Parameters:
output- The stream to write this object out to.- Throws:
java.io.IOException- If an error occurs while writing out this object.
-
-