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 intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns boolean value if it's type ofCosBooleanelse throws exception.doubleReturns double value if it's type ofCosNumericelse throws exception.abstract booleanThis method returns true if either they have same reference or have same data inside.booleanObject.equals(Object) is overridden here.Obtain the COS document that contains this object.longReturn EOF of object's update section or zero if cannot be determined.intIndirect object generation or -1 if directintIndirect object number or zero if directlongReturn object's position or zero if cannot be determined.intReturn index of object's update section or -1 if cannot be determined.Obtain the StreamManager for the document containing this object.abstract intgetType()return which of the concrete subtypes of CosObject we areabstract ObjectgetValue()Returns hex string value if it's type ofCosStringelse throws exception.intintValue()Accessor functions for scalar CosObjects.booleanReturns true if this INDIRECT object currently resides in an object stream.booleanisDirty()Returns if this cosobject is dirty, else false.booleanlongReturns long value if it's type ofCosNumericelse throws exception.Returns name value if it's type ofCosNameelse throws exception.Returns number value if it's type ofCosNumericelse throws exception.Returns string value if it's type ofCosStringelse throws exception.Returns text value if it's type ofCosStringelse 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:
PDFCosParseExceptionPDFIOExceptionPDFSecurityException
-
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 ofCosNumericelse throws exception. -
doubleValue
public double doubleValue()Returns double value if it's type ofCosNumericelse throws exception. -
numberValue
Returns number value if it's type ofCosNumericelse throws exception. -
booleanValue
public boolean booleanValue()Returns boolean value if it's type ofCosBooleanelse throws exception. -
nameValue
Returns name value if it's type ofCosNameelse throws exception. -
stringValue
Returns string value if it's type ofCosStringelse throws exception.- Throws:
PDFSecurityException
-
hexStringValue
Returns hex string value if it's type ofCosStringelse throws exception.- Throws:
PDFSecurityException
-
textValue
Returns text value if it's type ofCosStringelse 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.
-