Class CosObject
java.lang.Object
com.adobe.internal.pdftoolkit.core.cos.CosObject
- Direct Known Subclasses:
CosContainer
,CosScalar
Base class for all COS objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns boolean value if it's type ofCosBoolean
else throws exception.double
Returns double value if it's type ofCosNumeric
else throws exception.abstract boolean
This method returns true if either they have same reference or have same data inside.boolean
Object.equals(Object) is overridden here.Obtain the COS document that contains this object.long
Return EOF of object's update section or zero if cannot be determined.int
Indirect object generation or -1 if directint
Indirect object number or zero if directlong
Return object's position or zero if cannot be determined.int
Return index of object's update section or -1 if cannot be determined.Obtain the StreamManager for the document containing this object.abstract int
getType()
return which of the concrete subtypes of CosObject we areabstract Object
getValue()
Returns hex string value if it's type ofCosString
else throws exception.int
intValue()
Accessor functions for scalar CosObjects.boolean
Returns true if this INDIRECT object currently resides in an object stream.boolean
isDirty()
Returns if this cosobject is dirty, else false.boolean
long
Returns long value if it's type ofCosNumeric
else throws exception.Returns name value if it's type ofCosName
else throws exception.Returns number value if it's type ofCosNumeric
else throws exception.Returns string value if it's type ofCosString
else throws exception.Returns text value if it's type ofCosString
else throws exception.toString()
-
Field Details
-
t_Null
public static final int t_Null- See Also:
-
t_Numeric
public static final int t_Numeric- See Also:
-
t_Boolean
public static final int t_Boolean- See Also:
-
t_Name
public static final int t_Name- See Also:
-
t_String
public static final int t_String- See Also:
-
t_Array
public static final int t_Array- See Also:
-
t_Dictionary
public static final int t_Dictionary- See Also:
-
t_Stream
public static final int t_Stream- See Also:
-
t_ObjectRef
public static final int t_ObjectRef- See Also:
-
t_KeyAbsent
public static final int t_KeyAbsent- See Also:
-
DIRECT
public static final int DIRECT- See Also:
-
INDIRECT
public static final int INDIRECT- See Also:
-
-
Method Details
-
getType
public abstract int getType()return which of the concrete subtypes of CosObject we are- Returns:
- one of the t_Mumble static final int values defined above
-
getValue
- Returns:
- Object value of CosObject
- Throws:
PDFCosParseException
PDFIOException
PDFSecurityException
-
isIndirect
public boolean isIndirect() -
getObjNum
public int getObjNum()Indirect object number or zero if direct -
getObjGen
public int getObjGen()Indirect object generation or -1 if direct -
getObjEOF
public long getObjEOF()Return EOF of object's update section or zero if cannot be determined. -
getObjRevision
public int getObjRevision()Return index of object's update section or -1 if cannot be determined. -
getObjPos
public long getObjPos()Return object's position or zero if cannot be determined. -
isCompressed
public boolean isCompressed()Returns true if this INDIRECT object currently resides in an object stream. Returns false always if direct. -
intValue
public int intValue()Accessor functions for scalar CosObjects. These are defined in the base class to avoid having to make an explicit cast after determining the subclass by either getType() or instanceof. The ones defined in the base class all throw RuntimeException. For each scalar subclass the appropriate method is overridden, so getting here represents a "can't happen" situation. -
longValue
public long longValue()Returns long value if it's type ofCosNumeric
else throws exception. -
doubleValue
public double doubleValue()Returns double value if it's type ofCosNumeric
else throws exception. -
numberValue
Returns number value if it's type ofCosNumeric
else throws exception. -
booleanValue
public boolean booleanValue()Returns boolean value if it's type ofCosBoolean
else throws exception. -
nameValue
Returns name value if it's type ofCosName
else throws exception. -
stringValue
Returns string value if it's type ofCosString
else throws exception.- Throws:
PDFSecurityException
-
hexStringValue
Returns hex string value if it's type ofCosString
else throws exception.- Throws:
PDFSecurityException
-
textValue
Returns text value if it's type ofCosString
else throws exception.- Throws:
PDFSecurityException
-
getDocument
Obtain the COS document that contains this object.- Returns:
- COSDocument containing this object.
-
getStreamManager
Obtain the StreamManager for the document containing this object.- Returns:
- StreamManager to use for this COS object.
-
isDirty
public boolean isDirty()Returns if this cosobject is dirty, else false. -
toString
-
equals
This method returns true if either they have same reference or have same data inside. Returns false if passed CosObject is not on same document.- Parameters:
value
-- Returns:
- boolean
-
equals
Object.equals(Object) is overridden here.
-