|
jPod PDF library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.pdf.cos.COSDocumentElement
de.intarsys.pdf.cos.COSObject
public abstract class COSObject
Abstract superclass for all COS level object types
Field Summary | |
---|---|
static ICOSContainer |
CONSTANT_CONTAINER
This is the container for template objects. |
static ICOSContainer |
NULL_CONTAINER
This is the default container for non - contained objects. |
static Object |
SLOT_CONTAINER
|
Method Summary | |
---|---|
abstract void |
addObjectListener(ICOSObjectListener listener)
Add a listener for object changes. |
COSArray |
asArray()
this as a COSArray or null |
COSBoolean |
asBoolean()
|
COSDictionary |
asDictionary()
|
COSFixed |
asFixed()
|
COSInteger |
asInteger()
|
COSName |
asName()
|
COSNull |
asNull()
|
COSNumber |
asNumber()
|
COSStream |
asStream()
|
COSString |
asString()
|
abstract Iterator<COSDocumentElement> |
basicIterator()
An iterator over contained objects and references. |
COSObject |
beConstant()
Declare this to be a constant. |
COSIndirectObject |
beIndirect()
Make an indirect object out of a direct one. |
COSDocumentElement |
containable()
The COSDocumentElement suitable for use in an
ICOSContainer . |
abstract COSObject |
copyDeep()
Make a deep copy of the receiver within the same document. |
abstract COSObject |
copyDeep(Map copied)
Make a deep copy of the receiver within the same document. |
COSObject |
copyOptional()
Make a copy of the receiver within the same document. |
COSObject |
copyShallow()
Make a copy of the receiver. |
COSObject |
copySubGraph()
Make a copy of the receiver within the same document. |
COSObject |
dereference()
return the real object. this is needed for polymorphic handling of document elements. at application programming level only COSObject , never COSIndirectObject is seen. |
ICOSContainer |
getContainer()
Answer the object that contains this. |
COSDocument |
getDoc()
The document that contains this. |
COSIndirectObject |
getIndirectObject()
return the indirect object for the receiver. application level programmers should not use this method. this is needed for creating a physical representation of the document (serializing) |
boolean |
getValueBoolean(boolean defaultValue)
"Cast" the receiver to a Java boolean. |
byte[] |
getValueBytes(byte[] defaultValue)
"Cast" the receiver to a Java byte[].This is a convenience method to ease programming with COSObject . |
float |
getValueFloat(float defaultValue)
"Cast" the receiver to a Java float.This is a convenience method to ease programming with COSObject . |
int |
getValueInteger(int defaultValue)
"Cast" the receiver to a Java int.This is a convenience method to ease programming with COSObject . |
String |
getValueString(String defaultValue)
"Cast" the receiver to a Java String.This is a convenience method to ease programming with COSObject . |
void |
harden()
"Harden" the reference to this object. |
boolean |
isDangling()
true if this object is not contained in a document
directly or indirectly. |
boolean |
isIndirect()
Answer true if this object is an indirect one. |
boolean |
isNull()
answer true if receiver is the null object |
boolean |
isNumber()
answer true if receiver is a number |
abstract boolean |
isObjectListenerAvailable()
true if an ICOSObjectListener is registered. |
abstract boolean |
isPrimitive()
Answer true if this object is of a primitive type |
boolean |
isSwapped()
Answer true if this elements content is swapped to a
persistent store. |
abstract Iterator |
iterator()
An iterator over contained objects. |
boolean |
mayBeSwapped()
true if this object may be swapped from memory by the
garbage collector. |
abstract void |
removeObjectListener(ICOSObjectListener listener)
Remove a listener for object changes. |
void |
restoreState(Object saveState)
|
void |
soften()
"Soften" the reference to this object. |
String |
stringValue()
A string representation for the receiver. |
String |
toString()
|
Methods inherited from class de.intarsys.pdf.cos.COSDocumentElement |
---|
accept, handleException, isReference |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.intarsys.tools.component.ISaveStateSupport |
---|
saveState |
Field Detail |
---|
public static final ICOSContainer CONSTANT_CONTAINER
public static final ICOSContainer NULL_CONTAINER
public static final Object SLOT_CONTAINER
Method Detail |
---|
public abstract void addObjectListener(ICOSObjectListener listener)
listener
- The listener to be informed about changes.public COSArray asArray()
this
as a COSArray
or null
this
as a COSArray or null
public COSBoolean asBoolean()
this
as a COSBoolean
or null
public COSDictionary asDictionary()
this
as a COSDictionary
or
null
public COSFixed asFixed()
this
as a COSFixed
or null
public COSInteger asInteger()
this
as a COSInteger
or null
public COSName asName()
this
as a COSName
or null
public COSNull asNull()
this
as a COSNull
or null
public COSNumber asNumber()
this
as a COSNumber
or null
public COSStream asStream()
this
as a COSStream
or null
public COSString asString()
this
as a COSString
or null
public abstract Iterator<COSDocumentElement> basicIterator()
This iterator returns COSDocumentElements, leaving references alone.
public COSObject beConstant()
public COSIndirectObject beIndirect()
It is possible to morph existing objects into indirect ones, the objects in the hierarchy (container/document) are informed and will reflect the change.
public COSDocumentElement containable()
COSDocumentElement
COSDocumentElement
suitable for use in an
ICOSContainer
. This may be a COSIndirectObject
or the
COSObject
itself if not indirect.
This method should not be used by the application programmer. This is
called in the COSObject
lifecycle to ensure internal consistency.
containable
in class COSDocumentElement
public abstract COSObject copyDeep()
The algorithm copies this
along with all outgoing
references (recursively).
Object identity is preserved.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
public abstract COSObject copyDeep(Map copied)
The copied
map is used to identify objects copied in
earlier runs of this method to avoid duplicating resources used in
different copy targets (for example the pages of a document).
copied
is modified while executing copyDeep
and contains a mapping from indirect objects in the original document to
copied objects.
The algorithm copies this
along with all outgoing
references (recursively).
Object identity is preserved.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
copyDeep()
public final COSObject copyOptional()
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
public COSObject copyShallow()
A copy is made of the receiver and after this recursively of all not indirect objects.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
public final COSObject copySubGraph()
The algorithm copies this
along with all outgoing
references (recursively) that themselve have a navigation path to
this
. The result is a new subgraph extending from the
copy of this
where no navigation path leads back to
this
.
Object identity is preserved.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
public COSObject dereference()
COSObject
, never COSIndirectObject
is seen.
dereference
in class COSDocumentElement
COSObject
public ICOSContainer getContainer()
public COSDocument getDoc()
This may return null, as COSObject graphs may be created "offline" and add to the document as a whole.
The document is evaluated via the COSObject graph hierarchy that finally must be contained within a document.
getDoc
in class COSDocumentElement
public COSIndirectObject getIndirectObject()
public boolean getValueBoolean(boolean defaultValue)
COSObject
.
defaultValue
- The default value to return.
public byte[] getValueBytes(byte[] defaultValue)
COSObject
.
defaultValue
- The default value to return.
public float getValueFloat(float defaultValue)
COSObject
.
defaultValue
- The default value to return.
public int getValueInteger(int defaultValue)
COSObject
.
defaultValue
- The default value to return.
public String getValueString(String defaultValue)
COSObject
.
defaultValue
- The default value to return.
public void harden()
public boolean isDangling()
true
if this object is not contained in a document
directly or indirectly. This is especially true when an object is new (or
reset to this state when an undo happend). Remember that an object can
still be garbage, even if it is not dangling.
true
if this object is not contained in a document
directly or indirectly.public boolean isIndirect()
true
if this object is an indirect one.
true
if this object is an indirect one.public boolean isNull()
public boolean isNumber()
public abstract boolean isObjectListenerAvailable()
true
if an ICOSObjectListener
is registered. This
is for test purposes.
public abstract boolean isPrimitive()
public boolean isSwapped()
COSDocumentElement
true
if this elements content is swapped to a
persistent store.
isSwapped
in class COSDocumentElement
true
if this elements content is swapped to
a persistent store.public abstract Iterator iterator()
This iterator returns only COSObject instances, references are dereferenced.
public boolean mayBeSwapped()
true
if this object may be swapped from memory by the
garbage collector.
true
if this object may be swapped from memory by
the garbage collector.public abstract void removeObjectListener(ICOSObjectListener listener)
listener
- The listener to be removed.public void restoreState(Object saveState)
restoreState
in interface de.intarsys.tools.component.ISaveStateSupport
public void soften()
public String stringValue()
public String toString()
toString
in class Object
|
jPod PDF library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |