|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.util.StaticFields
The class StaticFields contains a
general static method to extract the public static
fields from a given class with given field type.
The class also contains two special static methods that deal with a field whose type is int.
This class cannot be instantiated.
| Constructor Summary | |
private |
StaticFields()
Prevent instantiation. |
| Method Summary | |
static Field[] |
getPublicStaticFields(Class type,
Class fieldtype)
Returns the public static fields in the given class of the given field type. |
static StringIntPair[] |
getPublicStaticIntFieldData(Class type)
For each public static field in the given class of field type int, create a StringIntPair with the name of the field and its int value; then return all such pairs in a StringIntPair array. |
static int[] |
getPublicStaticIntFieldValues(Class type)
For each public static field in the given class of field type int, extract the int value; then return all such extracted int values in an int array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
private StaticFields()
| Method Detail |
public static Field[] getPublicStaticFields(Class type,
Class fieldtype)
Returns the public static fields in the given class of the given field type.
Returns null if type
is null.
Returns all public static fields if
fieldtype is null.
type - the class type to inspectfieldtype - the field type of the
desired public static fieldspublic static StringIntPair[] getPublicStaticIntFieldData(Class type)
For each public static field in the given class of field type int, create a StringIntPair with the name of the field and its int value; then return all such pairs in a StringIntPair array.
In case of an error in extracting the int value, an error message will be appended to the field name before the corresponding StringIntPair is created.
type - the class type to inspectpublic static int[] getPublicStaticIntFieldValues(Class type)
For each public static field in the given class of field type int, extract the int value; then return all such extracted int values in an int array.
In case of an error in extracting the int value, a value of 0 will be used.
type - the class type to inspect
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||