|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.ps.PsObjectComposite
org.foray.ps.PsDictionary
public class PsDictionary
A PostScript dictionary.
Field Summary | |
---|---|
static byte |
DEFAULT_FONT_DICTIONARY_SIZE
Constant indicating the default size of a new dictionary. |
Constructor Summary | |
---|---|
PsDictionary(int initialSize)
Constructor. |
Method Summary | |
---|---|
void |
addItem(PsInterpreter4a interpreter,
PsObject key,
PsObject value)
Add an entry to the dictonary. |
PsObject |
duplicate()
This is a shallow copy. |
protected boolean |
execute(PsInterpreter4a interpreter,
PsName nameObject)
Tries to process a name object. |
protected boolean |
executeOperator(PsOperator operatorEnum)
Override this method in subclasses that have procedures. |
Boolean |
getBoolean(String key)
Returns a value expected to be a Boolean from this dictionary. |
PsObject |
getItem(PsObject key)
Return the value for a given key. |
PsObject |
getItem(String key)
Return the value for a given key. |
Map<PsObject,PsObject> |
getMap()
Return the encapsulated Map. |
String |
getName(String key)
Returns a value expected to be a Name from this dictionary. |
BigDecimal |
getNumber(String key)
Returns a value expected to be a Number from this dictionary. |
String |
getString(String key)
Returns a value expected to be a String from this dictionary. |
PsName |
getTypeName()
Needed for the "type" operator. |
boolean |
isComparable(PsObject object)
Test the comparability of two PSObjects. |
boolean |
isComposite()
The method should be overridden by composite objects. |
boolean |
isExecutable()
Indicates whether this object is executable. |
boolean |
isValidFontDictionary()
The conditions tested here are the "Required" entries as defined in PLRM2, Section 5.2, especially Tables 5.1, 5.2, and 5.3. |
int |
maxLength()
See maxLength() operator for details. |
int |
size()
Return the size of this dictionary. |
Methods inherited from class org.foray.ps.PsObjectComposite |
---|
getAccess, setAccess |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte DEFAULT_FONT_DICTIONARY_SIZE
Constructor Detail |
---|
public PsDictionary(int initialSize)
initialSize
- The number of elements that this dictionary should be
sized for as it is created.Method Detail |
---|
protected boolean execute(PsInterpreter4a interpreter, PsName nameObject) throws PsOperatorException, PsInterpreterException4a
interpreter
- The parent interpreter.nameObject
- The PsName instance that should be executed.
PsOperatorException
- For errors executing operators.
PsInterpreterException4a
- For any PostScript error.protected boolean executeOperator(PsOperator operatorEnum) throws PsOperatorException, PsInterpreterException4a
operatorEnum
- The integral ID that identifies which operator should
be executed
PsOperatorException
- For errors executing operators.
PsInterpreterException4a
- For any PostScript error.public PsObject duplicate()
PsObject
public boolean isComposite()
PsObject
public void addItem(PsInterpreter4a interpreter, PsObject key, PsObject value) throws PsInterpreterException4a
interpreter
- The parent interpreter.key
- The key to the dictionary entry.value
- The value of the dictionary entry.
PsInterpreterException4a
- A typecheck error if the object is null.public PsObject getItem(PsObject key)
key
- The key whose value should be retrieved.
public PsObject getItem(String key)
key
- The key whose value should be retrieved.
public boolean isExecutable()
PsObject
public boolean isValidFontDictionary()
public boolean isComparable(PsObject object)
PsObject
object
- The object that should be tested for comparability.
this
is comparable to object
,
false otherwise.public PsName getTypeName()
PsObject
public Map<PsObject,PsObject> getMap()
public int size()
public int maxLength()
maxLength()
operator for details.
public String getString(String key)
key
- The key to the expected String value.
key
, if it is found and is a PsString
, or null
otherwise.public String getName(String key)
key
- The key to the expected Name value.
key
, if it is found and is a PsName
, or null
otherwise.public BigDecimal getNumber(String key)
key
- The key to the expected Number value.
key
, if it is found and is a PsNumber
, or null
otherwise.public Boolean getBoolean(String key)
key
- The key to the expected Boolean value.
key
, if it is found and is a PsBoolean
, or null
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |