|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.kcl.cch.jb.pliny.model.AttributedResourceHandler
provides a tool to manage the Resource attributes field as a
java.util.Properties
item. In this way, users of this item can
store a range of properties in the single attributes field without
needing to modify the DB definition to add more DB fields.
It is important to recognise, of course, that storing data using this tool means that the DB engine itself is not going to be very good at selected items from the DB records that are based on values of these stored values.
Constructor Summary | |
AttributedResourceHandler(Resource myResource)
creates an instance of this item that will manage data for the given Resource record. |
Method Summary | |
float |
getFloat(String propName)
looks up value in the properties associated with this Resource's attribute field, and returns it as an float . |
String |
getIdentifier()
|
int |
getInt(String propName)
looks up value in the properties associated with this Resource's attribute field, and returns it as an Integer . |
org.eclipse.draw2d.geometry.Rectangle |
getRectangle(String propName)
looks up value in the properties associated with this Resource's attribute field, and returns it as an draw2d Rectangle . |
String |
getString(String propName)
looks up value in the properties associated with this Resource 's
attribute field, and returns it as a String . |
void |
updateFloat(String propName,
float value)
takes the given value as a float and stores it as the value
associated with the given attribute name propName . |
void |
updateInt(String propName,
int value)
takes the given value as an int and stores it as the value
associated with the given attribute name propName . |
void |
updateRectangle(String propName,
org.eclipse.draw2d.geometry.Rectangle r)
takes the given value as a draw2d Rectangle and stores it as the value
associated with the given attribute name propName . |
void |
updateString(String propName,
String value)
takes the given value as a String and stores it as the value
associated with the given attribute name propName . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AttributedResourceHandler(Resource myResource)
Resource
record.
myResource
- Method Detail |
public String getIdentifier()
public String getString(String propName)
Resource
's
attribute field, and returns it as a String
.
null
means that the attributes was not found.
propName
- name of property.
public int getInt(String propName)
Integer
.
null
means that the attributes was not found.
propName
- name of property.
public float getFloat(String propName)
float
.
null
means that the attributes was not found.
propName
- name of property.
public org.eclipse.draw2d.geometry.Rectangle getRectangle(String propName)
Rectangle
.
null
means that the attributes was not found.
propName
- name of property.
public void updateString(String propName, String value)
value
as a String and stores it as the value
associated with the given attribute name propName
.
The DB field attribute is updated to reflect the new value for this item.
propName
- String that names the attributevalue
- String value that it is to be assigned.public void updateInt(String propName, int value)
value
as an int
and stores it as the value
associated with the given attribute name propName
.
The DB field attribute is updated to reflect the new value for this item.
propName
- String that names the attributevalue
- int
value that it is to be assigned.public void updateFloat(String propName, float value)
value
as a float
and stores it as the value
associated with the given attribute name propName
.
The DB field attribute is updated to reflect the new value for this item.
propName
- String that names the attributevalue
- float
value that it is to be assigned.public void updateRectangle(String propName, org.eclipse.draw2d.geometry.Rectangle r)
value
as a draw2d Rectangle
and stores it as the value
associated with the given attribute name propName
.
The DB field attribute is updated to reflect the new value for this item.
propName
- String that names the attributer
- draw2d Rectangle
value that it is to be assigned.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |