|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrle.core.data.RuntimeData
public class RuntimeData
Class to manage a runtime data set of possibly related attributes. This class requires a list of InfoView objects specifying legal attributes.
The parameters: dependencies - a Listof legal attributes an attribute depends on type - COMPUTED attributes cannot be set directly, but must be computed using a PlugIn RuntimeComputer. CONSTANT attributes must be set by the Variant Manager, and can't change PERSISTENT attributes are saved in save files, and not computed. computer.classname - the RuntimeComputer for computed values computer.parameters - parameters to the RuntimeComputer
| Field Summary | |
|---|---|
protected java.util.HashMap<java.lang.String,InfoView> |
attributes
|
protected java.util.HashSet<java.lang.String> |
disposedKeys
|
protected java.lang.Object |
owner
|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
values
|
| Constructor Summary | |
|---|---|
RuntimeData()
Constructor with null owner. |
|
RuntimeData(java.lang.Object owner)
Constructor with owner. |
|
RuntimeData(java.lang.Object owner,
RuntimeData toCopy)
Constructor with owner and data to copy. |
|
| Method Summary | |
|---|---|
void |
addDisposalListener(DisposalListener dl)
Add a DisposalListener that will be notified of all property changes |
void |
addDisposalListener(java.lang.String prop,
DisposalListener dl)
Add a DisposalListener that will be notified only of changes to a single property. |
void |
addRuntimeDataListener(RuntimeDataListener pcl)
Add a RuntimeDataListener that will be notified of all property changes |
void |
addRuntimeDataListener(java.lang.String prop,
RuntimeDataListener pcl)
Add a RuntimeDataListener that will be notified only of changes to a single property. |
boolean |
check(java.lang.String s)
Attempt to retrieve the boolean value s. |
protected java.lang.Object |
compute(InfoView attribute)
Determine the value for attribute using the specified RuntimeComputer. |
void |
disposeAllComputed()
Dispose all computed attributes. |
void |
disposeComputed(InfoView attribute)
Remove any existing value for this computed attribute. |
void |
disposeComputed(java.lang.String key)
Dispose the attribute represented by key, which must be computed. |
protected java.util.Set<InfoView> |
findDependentAttributes(InfoView attribute)
Find the attributes which depend on attribute. |
void |
fireDisposal(java.lang.String property)
Notify all DisposalListeners that a value has changed. |
void |
firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue,
Cause cause)
Notify all RuntimeDataListeners that a value has changed. |
java.lang.Object |
get(java.lang.String key)
Get the value for attribute key. |
java.lang.Number |
getConstant(java.lang.String key)
Return a view of the lookup table attribute specified by key. |
java.lang.Integer |
getInt(java.lang.String s)
Attempt to retrieve an int value using StringUtil.intValue() |
LookupTableView |
getLookupTable(java.lang.String key)
Return a view of the lookup table attribute specified by key. |
java.lang.Object |
getOwner()
|
java.lang.String |
getString(java.lang.String name)
Get a "safe" String value. |
protected void |
putValue(java.lang.String key,
java.lang.Object oldValue,
java.lang.Object newValue,
Cause cause)
Directly sets a value, be it computed, costant or persistent, and calls firePropertyChange(). |
void |
removeDisposalListener(DisposalListener dl)
Remove a DisposalListener that was to be notified of all property changes |
void |
removeDisposalListener(java.lang.String prop,
DisposalListener dl)
Remove a DisposalListener that was to be notified only of changes to a single property. |
void |
removeRuntimeDataListener(RuntimeDataListener pcl)
Remove a RuntimeDataListener that was to be notified of all property changes |
void |
removeRuntimeDataListener(java.lang.String prop,
RuntimeDataListener pcl)
Remove a RuntimeDataListener that was to be notified only of changes to a single property. |
void |
set(java.lang.String key,
java.lang.Object value)
|
void |
set(java.lang.String key,
java.lang.Object value,
Cause cause)
Set the value for the attribute key. |
void |
setAttributeList(java.util.List<InfoView> list)
Set the list of legal attributes. |
void |
setOwner(java.lang.Object owner)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object owner
protected java.util.HashMap<java.lang.String,java.lang.Object> values
protected java.util.HashMap<java.lang.String,InfoView> attributes
protected java.util.HashSet<java.lang.String> disposedKeys
| Constructor Detail |
|---|
public RuntimeData(java.lang.Object owner,
RuntimeData toCopy)
public RuntimeData(java.lang.Object owner)
public RuntimeData()
| Method Detail |
|---|
public java.lang.Object getOwner()
public void setOwner(java.lang.Object owner)
public void setAttributeList(java.util.List<InfoView> list)
public LookupTableView getLookupTable(java.lang.String key)
public java.lang.Number getConstant(java.lang.String key)
public java.lang.String getString(java.lang.String name)
name -
public java.lang.Integer getInt(java.lang.String s)
s -
public boolean check(java.lang.String s)
s -
public java.lang.Object get(java.lang.String key)
key -
protected java.lang.Object compute(InfoView attribute)
attribute -
protected void putValue(java.lang.String key,
java.lang.Object oldValue,
java.lang.Object newValue,
Cause cause)
key - oldValue - newValue - public void disposeComputed(InfoView attribute)
attribute - public void disposeComputed(java.lang.String key)
key - public void disposeAllComputed()
public void set(java.lang.String key,
java.lang.Object value)
public void set(java.lang.String key,
java.lang.Object value,
Cause cause)
key - value - protected java.util.Set<InfoView> findDependentAttributes(InfoView attribute)
public void fireDisposal(java.lang.String property)
property - oldValue - newValue - public void addDisposalListener(DisposalListener dl)
dl - public void removeDisposalListener(DisposalListener dl)
dl -
public void addDisposalListener(java.lang.String prop,
DisposalListener dl)
prop - - the property we're interested indl -
public void removeDisposalListener(java.lang.String prop,
DisposalListener dl)
prop - - the property we're interested indl -
public void firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue,
Cause cause)
property - oldValue - newValue - public void addRuntimeDataListener(RuntimeDataListener pcl)
pcl - public void removeRuntimeDataListener(RuntimeDataListener pcl)
pcl -
public void addRuntimeDataListener(java.lang.String prop,
RuntimeDataListener pcl)
prop - - the property we're interested inpcl -
public void removeRuntimeDataListener(java.lang.String prop,
RuntimeDataListener pcl)
prop - - the property we're interested inpcl - public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||