intarsys PDF library API

de.intarsys.pdf.cds
Class CDSNameTreeNode

java.lang.Object
  extended by de.intarsys.pdf.cos.COSBasedObject
      extended by de.intarsys.pdf.cds.CDSBase
          extended by de.intarsys.pdf.cds.CDSTreeNode
              extended by de.intarsys.pdf.cds.CDSNameTreeNode
All Implemented Interfaces:
ICOSObjectListener, IAttributeSupport

public class CDSNameTreeNode
extends CDSTreeNode

Implementation of the PDF name tree.


Nested Class Summary
 
Nested classes/interfaces inherited from class de.intarsys.pdf.cos.COSBasedObject
COSBasedObject.MetaClass
 
Field Summary
static COSName DK_Names
           
 
Fields inherited from class de.intarsys.pdf.cds.CDSTreeNode
DK_Kids, DK_Limits
 
Fields inherited from class de.intarsys.pdf.cos.COSBasedObject
META
 
Method Summary
 void addAll(CDSNameTreeNode node)
          Add all children from node.
 boolean contains(COSString name)
          Answer true if the receiver subtree contains a key that matches the parameter.
static CDSNameTreeNode createFromCos(COSDictionary node)
          Create the correct concrete CDSTreeNode implementation for node.
static CDSTreeNode createIntermediate()
           
static CDSNameTreeNode createLeaf()
           
static CDSNameTreeNode createRootIntermediate()
           
static CDSNameTreeNode createRootLeaf()
           
 COSObject get(COSString name)
          Answer the value associated with the key name.
 List getEntries()
           
 List getKids()
           
 COSArray getLimits()
          Return the two element array containing the smallest and the largest key within the receiver subtree.
 COSString getMax()
          The maximum key within the receiver subtree.
 COSString getMin()
          The minimum key within the receiver subtree.
 boolean isLeaf()
           
 Iterator iterator()
          An Iterator on all leaf fields in the subtree.
 boolean mayContain(COSString name)
          Answer true if the receiver MAY contain the key name.
 COSObject put(COSString name, COSObject value)
          Store value under the key given in name.
 COSObject remove(COSString name)
          Remove the mapping for key given in name.
 
Methods inherited from class de.intarsys.pdf.cds.CDSTreeNode
isIntermediate
 
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject
changed, cosGetArray, cosGetDict, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, invalidateCaches, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DK_Names

public static final COSName DK_Names
Method Detail

createFromCos

public static CDSNameTreeNode createFromCos(COSDictionary node)
Create the correct concrete CDSTreeNode implementation for node.

Parameters:
node - The COSDictionary defining a CDSTreeNode subclass instance
Returns:
The concrete CDSTreeNode implementation for node.

createRootIntermediate

public static CDSNameTreeNode createRootIntermediate()

createRootLeaf

public static CDSNameTreeNode createRootLeaf()

createIntermediate

public static CDSTreeNode createIntermediate()

createLeaf

public static CDSNameTreeNode createLeaf()

getKids

public List getKids()

addAll

public void addAll(CDSNameTreeNode node)
Add all children from node.

Parameters:
node - A CDSNameTreeNode whose children are copied.

contains

public boolean contains(COSString name)
Answer true if the receiver subtree contains a key that matches the parameter.

Parameters:
name - The key that is searched in the receiver subtree.
Returns:
Answer true if the receiver subtree contains a key that matches the parameter.

get

public COSObject get(COSString name)
Answer the value associated with the key name. If no key is available that matches the parameter, COSNull is returned.

Parameters:
name - The key whose value is looked up.
Returns:
Answer the value associated with the key name.

getLimits

public COSArray getLimits()
Return the two element array containing the smallest and the largest key within the receiver subtree.

Returns:
Return the two element array containing the smallest and the largest key within the receiver subtree.

getMax

public COSString getMax()
The maximum key within the receiver subtree.

Returns:
The maximum key within the receiver subtree.

getMin

public COSString getMin()
The minimum key within the receiver subtree.

Returns:
The minimum key within the receiver subtree.

iterator

public Iterator iterator()
An Iterator on all leaf fields in the subtree.

Returns:
An Iterator on all leaf fields in the subtree.

mayContain

public boolean mayContain(COSString name)
Answer true if the receiver MAY contain the key name.

Thi means, name lies between the range defined by the lower und upper limit key of the receiver.

Parameters:
name - The key name to lookup.
Returns:
Answer true if the receiver MAY contain the key name.

put

public COSObject put(COSString name,
                     COSObject value)
Store value under the key given in name.

Parameters:
name - The name with wich the value should be associated.
value - The value to associate with the name.
Returns:
The object previously associated with name or COSNull.

remove

public COSObject remove(COSString name)
Remove the mapping for key given in name.

Parameters:
name - The name fo the mapping to be removed
Returns:
The object previously associated with name or COSNull.

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in class CDSTreeNode

getEntries

public List getEntries()

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.