public class PDFDictionary extends PDFObject
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
entries
the entry map
|
protected List<String> |
order
maintains the order of the entries added to the entry map.
|
Constructor and Description |
---|
PDFDictionary()
Create a new dictionary object.
|
PDFDictionary(PDFObject parent)
Create a new dictionary object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String name) |
Object |
get(String name)
Returns the value given a name.
|
static void |
getChildren(Collection<Object> values,
Set<PDFObject> children) |
void |
getChildren(Set<PDFObject> children) |
Set<String> |
keySet() |
int |
output(OutputStream stream)
Write the PDF represention of this object
|
void |
put(String name,
int value)
Puts a new name/value pair.
|
void |
put(String name,
Object value)
Puts a new name/value pair.
|
void |
remove(String name)
Removes the mapping for the specified key
|
protected void |
writeDictionary(OutputStream out,
StringBuilder textBuffer)
Writes the contents of the dictionary to a StringBuffer.
|
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, supportsObjectStream, toPDF, toPDFString
public PDFDictionary()
public PDFDictionary(PDFObject parent)
parent
- the object's parent if anypublic void put(String name, Object value)
name
- the namevalue
- the valuepublic void put(String name, int value)
name
- the namevalue
- the valuepublic Object get(String name)
name
- the name of the valuepublic int output(OutputStream stream) throws IOException
output
in class PDFObject
stream
- the stream to write the PDF toIOException
- if there is an error writing to the streamprotected void writeDictionary(OutputStream out, StringBuilder textBuffer) throws IOException
out
- the OutputStream (for binary content)textBuffer
- the text buffer for text outputIOException
- if an I/O error occurspublic void getChildren(Set<PDFObject> children)
getChildren
in class PDFObject
public static void getChildren(Collection<Object> values, Set<PDFObject> children)
public boolean containsKey(String name)
name
- The key to find in the map.Map.containsKey(Object)
public void remove(String name)
name
- key whose mapping is to be removedCopyright © 2025 Apache Software Foundation. All rights reserved.