|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--edu.berkeley.guir.lib.properties.FlexProperties
|
+--edu.berkeley.guir.lib.properties.ClassProperties
Inheritable properties for a class.
You can put in properties for a class of objects in here, and then retrieve them by specifying a class or by passing in an object. There are two advantages to putting key-values in here over putting them as static values in the class:
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Jun 02 2000, JH
Created class
- GUIRLib-v1.2-1.0.0, Jun 22 2000, JH
Touched for GUIRLib release
- GUIRLib-v1.3-1.0.0, Aug 11 2000, JH
Touched for GUIRLib release
- GUIRLib-v1.4-1.0.0, Aug 31 2000, JH
Touched for GUIRLib release
| Fields inherited from interface edu.berkeley.guir.lib.properties.PropertyConstants |
PROPERTY_BOUND, PROPERTY_CONSTRAINED, PROPERTY_INDEXED, PROPERTY_SIMPLE |
| Constructor Summary | |
ClassProperties()
|
|
| Method Summary | |
String |
generateClassKey(Class cl,
String key)
Given a class and a property name, generate a key. |
String |
generateDefaultKey(String key)
Generate the default value for a key. |
Object |
getClassProperty(Class cl,
String key)
Recursively go up the inheritance chain, finding the first class that has a value for this key. |
static void |
main(String[] argv)
|
Object |
removeClassProperty(Class cl,
String key)
Remove the property for this class and key. |
void |
setClassProperty(Class cl,
String key,
Object newVal)
Put a property in for this class, overriding an old value if there is one. |
void |
setDefaultProperty(String key,
Object newVal)
Put a default value in for this key. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ClassProperties()
| Method Detail |
public String generateClassKey(Class cl,
String key)
public String generateDefaultKey(String key)
public Object getClassProperty(Class cl,
String key)
Keep in mind that this gets a reference to the specified key. Thus, if you modify the retrieved value, you modify it for everyone. You may want to make a clone of it first.
public void setDefaultProperty(String key,
Object newVal)
public void setClassProperty(Class cl,
String key,
Object newVal)
public Object removeClassProperty(Class cl,
String key)
public static void main(String[] argv)
throws Exception
|
Copyright Information | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||