public class Dictionary
extends java.lang.Object
type
entry
which is treated as a special case (to ensure it comes first in the output
if it is specified).Constructor and Description |
---|
Dictionary()
Creates a new instance with no type.
|
Dictionary(java.lang.String type)
Creates a new dictionary with the specified type (which can be
null ). |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getType()
Returns the dictionary type.
|
boolean |
isEmpty()
Returns
true if the dictionary has no entries, and
false otherwise. |
void |
put(java.lang.String key,
java.lang.Object value)
Puts an entry in the dictionary.
|
java.lang.Object |
remove(java.lang.String key)
Removes an entry from the dictionary, returning the value that was
stored previously.
|
void |
setType(java.lang.String type)
Sets the type (for example, "/Catalog").
|
int |
size()
Returns the number of items in the dictionary.
|
byte[] |
toPDFBytes()
Returns a byte array containing the ASCII encoding of the dictionary.
|
java.lang.String |
toPDFString()
Returns a string containing the PDF text describing the dictionary.
|
public Dictionary()
public Dictionary(java.lang.String type)
null
).type
- the type value (for example, "/Catalog").public java.lang.String getType()
null
).public void setType(java.lang.String type)
type
- the type (null
permitted).public boolean isEmpty()
true
if the dictionary has no entries, and
false
otherwise.size()
public int size()
public void put(java.lang.String key, java.lang.Object value)
key
- the key.value
- the value.public java.lang.Object remove(java.lang.String key)
key
- the key.public byte[] toPDFBytes()
public java.lang.String toPDFString()