Class CosObject
- java.lang.Object
-
- com.adobe.internal.pdftoolkit.core.cos.CosObject
-
- Direct Known Subclasses:
CosContainer,CosScalar
public abstract class CosObject extends java.lang.ObjectBase class for all COS objects.
-
-
Field Summary
Fields Modifier and Type Field Description static intDIRECTstatic intINDIRECTstatic intt_Arraystatic intt_Booleanstatic intt_Dictionarystatic intt_KeyAbsentstatic intt_Namestatic intt_Nullstatic intt_Numericstatic intt_ObjectRefstatic intt_Streamstatic intt_String
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanbooleanValue()Returns boolean value if it's type ofCosBooleanelse throws exception.doubledoubleValue()Returns double value if it's type ofCosNumericelse throws exception.abstract booleanequals(CosObject value)This method returns true if either they have same reference or have same data inside.booleanequals(java.lang.Object value)Object.equals(Object) is overridden here.CosDocumentgetDocument()Obtain the COS document that contains this object.longgetObjEOF()Return EOF of object's update section or zero if cannot be determined.intgetObjGen()Indirect object generation or -1 if directintgetObjNum()Indirect object number or zero if directlonggetObjPos()Return object's position or zero if cannot be determined.intgetObjRevision()Return index of object's update section or -1 if cannot be determined.StreamManagergetStreamManager()Obtain the StreamManager for the document containing this object.abstract intgetType()return which of the concrete subtypes of CosObject we areabstract java.lang.ObjectgetValue()ASHexStringhexStringValue()Returns hex string value if it's type ofCosStringelse throws exception.intintValue()Accessor functions for scalar CosObjects.booleanisCompressed()Returns true if this INDIRECT object currently resides in an object stream.booleanisDirty()Returns if this cosobject is dirty, else false.booleanisIndirect()longlongValue()Returns long value if it's type ofCosNumericelse throws exception.ASNamenameValue()Returns name value if it's type ofCosNameelse throws exception.java.lang.NumbernumberValue()Returns number value if it's type ofCosNumericelse throws exception.ASStringstringValue()Returns string value if it's type ofCosStringelse throws exception.java.lang.StringtextValue()Returns text value if it's type ofCosStringelse throws exception.java.lang.StringtoString()
-
-
-
Field Detail
-
t_Null
public static final int t_Null
- See Also:
- Constant Field Values
-
t_Numeric
public static final int t_Numeric
- See Also:
- Constant Field Values
-
t_Boolean
public static final int t_Boolean
- See Also:
- Constant Field Values
-
t_Name
public static final int t_Name
- See Also:
- Constant Field Values
-
t_String
public static final int t_String
- See Also:
- Constant Field Values
-
t_Array
public static final int t_Array
- See Also:
- Constant Field Values
-
t_Dictionary
public static final int t_Dictionary
- See Also:
- Constant Field Values
-
t_Stream
public static final int t_Stream
- See Also:
- Constant Field Values
-
t_ObjectRef
public static final int t_ObjectRef
- See Also:
- Constant Field Values
-
t_KeyAbsent
public static final int t_KeyAbsent
- See Also:
- Constant Field Values
-
DIRECT
public static final int DIRECT
- See Also:
- Constant Field Values
-
INDIRECT
public static final int INDIRECT
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public abstract java.lang.Object getValue() throws PDFCosParseException, PDFIOException, PDFSecurityException- 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
public java.lang.Number 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
public ASName nameValue()
Returns name value if it's type ofCosNameelse throws exception.
-
stringValue
public ASString stringValue() throws PDFSecurityException
Returns string value if it's type ofCosStringelse throws exception.- Throws:
PDFSecurityException
-
hexStringValue
public ASHexString hexStringValue() throws PDFSecurityException
Returns hex string value if it's type ofCosStringelse throws exception.- Throws:
PDFSecurityException
-
textValue
public java.lang.String textValue() throws PDFSecurityExceptionReturns text value if it's type ofCosStringelse throws exception.- Throws:
PDFSecurityException
-
getDocument
public CosDocument getDocument()
Obtain the COS document that contains this object.- Returns:
- COSDocument containing this object.
-
getStreamManager
public StreamManager 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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public abstract boolean equals(CosObject value)
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
public boolean equals(java.lang.Object value)
Object.equals(Object) is overridden here.- Overrides:
equalsin classjava.lang.Object
-
-