org.pdfbox.pdmodel.common
Class COSDictionaryMap

java.lang.Object
  extended byorg.pdfbox.pdmodel.common.COSDictionaryMap
All Implemented Interfaces:
Map

public class COSDictionaryMap
extends Object
implements Map

This is a Map that will automatically sync the contents to a COSDictionary.

Version:
$Revision: 1.10 $
Author:
Ben Litchfield

Nested Class Summary
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Constructor Summary
COSDictionaryMap(Map actualsMap, COSDictionary dicMap)
          Constructor for this map.
 
Method Summary
 void clear()
          
 boolean containsKey(Object key)
          
 boolean containsValue(Object value)
          
static COSDictionary convert(Map someMap)
          This will take a map<java.lang.String,org.pdfbox.pdmodel.COSObjectable> and convert it into a COSDictionary<COSName,COSBase>.
static COSDictionaryMap convertBasicTypesToMap(COSDictionary map)
          This will take a COS dictionary and convert it into COSDictionaryMap.
 Set entrySet()
          
 boolean equals(Object o)
          
 Object get(Object key)
          
 int hashCode()
          
 boolean isEmpty()
          
 Set keySet()
          
 Object put(Object key, Object value)
          
 void putAll(Map t)
          
 Object remove(Object key)
          
 int size()
          
 String toString()
          
 Collection values()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

COSDictionaryMap

public COSDictionaryMap(Map actualsMap,
                        COSDictionary dicMap)
Constructor for this map.

Parameters:
actualsMap - The map with standard java objects as values.
dicMap - The map with COSBase objects as values.
Method Detail

size

public int size()

Specified by:
size in interface Map

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface Map

containsKey

public boolean containsKey(Object key)

Specified by:
containsKey in interface Map

containsValue

public boolean containsValue(Object value)

Specified by:
containsValue in interface Map

get

public Object get(Object key)

Specified by:
get in interface Map

put

public Object put(Object key,
                  Object value)

Specified by:
put in interface Map

remove

public Object remove(Object key)

Specified by:
remove in interface Map

putAll

public void putAll(Map t)

Specified by:
putAll in interface Map

clear

public void clear()

Specified by:
clear in interface Map

keySet

public Set keySet()

Specified by:
keySet in interface Map

values

public Collection values()

Specified by:
values in interface Map

entrySet

public Set entrySet()

Specified by:
entrySet in interface Map

equals

public boolean equals(Object o)

Specified by:
equals in interface Map

toString

public String toString()


hashCode

public int hashCode()

Specified by:
hashCode in interface Map

convert

public static COSDictionary convert(Map someMap)
This will take a map<java.lang.String,org.pdfbox.pdmodel.COSObjectable> and convert it into a COSDictionary<COSName,COSBase>.

Parameters:
someMap - A map containing COSObjectables
Returns:
A proper COSDictionary

convertBasicTypesToMap

public static COSDictionaryMap convertBasicTypesToMap(COSDictionary map)
                                               throws IOException
This will take a COS dictionary and convert it into COSDictionaryMap. All cos objects will be converted to their primitive form.

Parameters:
map - The COS mappings.
Returns:
A standard java map.
Throws:
IOException - If there is an error during the conversion.