T
- The type of the values in this name tree.public abstract class PDNameTreeNode<T extends COSObjectable> extends java.lang.Object implements COSObjectable
Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
private COSDictionary |
node |
private PDNameTreeNode<T> |
parent |
Modifier | Constructor and Description |
---|---|
protected |
PDNameTreeNode()
Constructor.
|
protected |
PDNameTreeNode(COSDictionary dict)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
calculateLimits() |
protected abstract T |
convertCOSToPD(COSBase base)
Method to convert the COS value in the name tree to the PD Model object.
|
protected abstract PDNameTreeNode<T> |
createChildNode(COSDictionary dic)
Create a child node object.
|
COSDictionary |
getCOSObject()
Convert this standard java object to a COS object.
|
java.util.List<PDNameTreeNode<T>> |
getKids()
Return the children of this node.
|
java.lang.String |
getLowerLimit()
Get the lowest value for a key in the name map.
|
java.util.Map<java.lang.String,T> |
getNames()
This will return a map of names on this level.
|
PDNameTreeNode<T> |
getParent()
Returns the parent node.
|
java.lang.String |
getUpperLimit()
Get the highest value for a key in the name map.
|
T |
getValue(java.lang.String name)
The name to retrieve.
|
boolean |
isRootNode()
Determines if this is a root node or not.
|
void |
setKids(java.util.List<? extends PDNameTreeNode<T>> kids)
Set the children of this named tree.
|
private void |
setLowerLimit(java.lang.String lower)
Set the lowest value for the key in the map.
|
void |
setNames(java.util.Map<java.lang.String,T> names)
Set the names for this node.
|
void |
setParent(PDNameTreeNode<T> parentNode)
Sets the parent to the given node.
|
private void |
setUpperLimit(java.lang.String upper)
Set the highest value for the key in the map.
|
private static final org.apache.commons.logging.Log LOG
private final COSDictionary node
private PDNameTreeNode<T extends COSObjectable> parent
protected PDNameTreeNode()
protected PDNameTreeNode(COSDictionary dict)
dict
- The dictionary that holds the name information.public COSDictionary getCOSObject()
getCOSObject
in interface COSObjectable
public PDNameTreeNode<T> getParent()
public void setParent(PDNameTreeNode<T> parentNode)
parentNode
- the node to be set as parentpublic boolean isRootNode()
public java.util.List<PDNameTreeNode<T>> getKids()
public void setKids(java.util.List<? extends PDNameTreeNode<T>> kids)
kids
- The children of this named tree.private void calculateLimits()
public T getValue(java.lang.String name) throws java.io.IOException
name
- The name in the tree.java.io.IOException
- If an there is a problem creating the destinations.public java.util.Map<java.lang.String,T> getNames() throws java.io.IOException
null
if the dictionary
contains no 'Names' entry on this level.java.io.IOException
- If there is an error while creating the sub types.getKids()
protected abstract T convertCOSToPD(COSBase base) throws java.io.IOException
base
- The COS object to convert.java.io.IOException
- If there is an error during creation.protected abstract PDNameTreeNode<T> createChildNode(COSDictionary dic)
dic
- The dictionary for the child node object to refer to.public void setNames(java.util.Map<java.lang.String,T> names)
names
- map of names to objects, or null
for nothing.public java.lang.String getUpperLimit()
private void setUpperLimit(java.lang.String upper)
upper
- The new highest value for a key in the map.public java.lang.String getLowerLimit()
private void setLowerLimit(java.lang.String lower)
lower
- The new lowest value for a key in the map.