|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjpicedt.format.input.util.Pool
Offers a means for expressions belonging to the parser-tree to share variables across the tree. In addition to storing persistent data in some predefined public fields, this class also acts as a hashtable, and may thus store key/value pairs of objects of any class (these may be PicAttributeSet's, etc...), which may be shared across the whole parser-tree.
Nested Class Summary | |
static class |
Pool.Key
Enforces use of strong typing for keys being pushed in the map . |
Field Summary | |
static Pool.Key |
CURRENT_OBJ_ATTRIBUTES
Key used to fetch the attribute set attached to the current element "currentObj" |
PicGroup |
currentGroup
either the main drawing, or a subgroup ; each new parsed Element should be added to this group |
Element |
currentObj
Convenience used to share information (e.g. |
StringBuffer |
notParsed
a string that stores commands that couldn't be parsed in the current context (e.g. |
Stack |
picGroupStack
a fifo-like stack used to store the main drawing and its subgroups ; each time a "begin group" is encountered, the current PicGroup is pushed onto the stack, and a new PicGroup is instanciated, which then represents the current PicGroup ; the opposite operations are executed in the reverse order when a "end group" is found. |
Constructor Summary | |
Pool()
Simply call reinit() |
Method Summary | |
Object |
get(Pool.Key key)
Return the value associated with the given key |
PicAttributeSet |
getAttributeSet(Pool.Key key)
Convenience for retrieving a "PicAttributeSet" value ; can be used in conjunction with static methods defined in jpicedt.graphic.model.StyleConstants to retrieve attributes values with less burden. |
double |
getDouble(Pool.Key key)
Convenience for retrieving a "double" value from the pool's hashmap |
double |
put(Pool.Key key,
double d)
Convenience for storing a "double" value into the pool's hashmap |
Object |
put(Pool.Key key,
Object value)
Associates the specified value with the given key in the pool's hashmap |
void |
reinit()
Reset public fields values. |
void |
setAttribute(Pool.Key key,
PicAttributeName name,
Object value)
Add a name/value attribute pair to the attribute set with the given key, i.e. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public PicGroup currentGroup
public Stack picGroupStack
public Element currentObj
public StringBuffer notParsed
public static final Pool.Key CURRENT_OBJ_ATTRIBUTES
#get(String)
Constructor Detail |
public Pool()
Method Detail |
public void reinit()
public Object put(Pool.Key key, Object value)
public Object get(Pool.Key key)
public double getDouble(Pool.Key key)
public double put(Pool.Key key, double d)
public PicAttributeSet getAttributeSet(Pool.Key key)
key
- if CURRENT_OBJ_ATTRIBUTES, retrieves the attribute set of the current Element in the pool ;
any other key is acceptable as long as it corresponds to a valid entry in the Pool's hashtable,
that is, it has been previously pushed in the Pool using put(key, value)
.public void setAttribute(Pool.Key key, PicAttributeName name, Object value)
public String toString()
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |