public class Pool
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Pool.Key
Enforces use of strong typing for keys being pushed in the map .
|
Modifier and Type | Field and Description |
---|---|
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.
|
java.lang.StringBuffer |
notParsed
a string that stores commands that couldn't be parsed in the current context (e.g.
|
java.util.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 and Description |
---|
Pool()
Simply call reinit()
|
Modifier and Type | Method and Description |
---|---|
java.lang.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
|
java.lang.Object |
put(Pool.Key key,
java.lang.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,
java.lang.Object value)
Add a name/value attribute pair to the attribute set with the given key, i.e.
|
java.lang.String |
toString() |
public PicGroup currentGroup
public java.util.Stack picGroupStack
public Element currentObj
public java.lang.StringBuffer notParsed
public static final Pool.Key CURRENT_OBJ_ATTRIBUTES
#get(String)
public void reinit()
public java.lang.Object put(Pool.Key key, java.lang.Object value)
public java.lang.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, java.lang.Object value)
public java.lang.String toString()
toString
in class java.lang.Object
Submit a bug : syd@jpicedt.org