|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.PropertyPath
public class PropertyPath
A helper class for accessing properties in nested objects, e.g., accessing the "getRidge" method of a LinearRegression classifier part of MultipleClassifierCombiner, e.g., Vote. For doing so, one needs to supply the object to work on and a property path. The property path is a dot delimited path of property names ("getFoo()" and "setFoo(int)" have "foo" as property name), indices of arrays are 0-based. E.g.:
getPropertyDescriptor(vote, "classifiers[1].ridge")
will return
the second classifier (which should be our LinearRegression) of the given
Vote meta-classifier and there the property descriptor of the "ridge"
property. getValue(...)
will return the actual value of the
ridge parameter and setValue(...)
will set it.
Nested Class Summary | |
---|---|
static class |
PropertyPath.Path
Contains a (property) path structure |
static class |
PropertyPath.PathElement
Represents a single element of a property path |
Constructor Summary | |
---|---|
PropertyPath()
|
Method Summary | |
---|---|
static weka.core.PropertyPath.PropertyContainer |
find(Object src,
PropertyPath.Path path)
returns the property and object associated with the given path, null if a problem occurred. |
static PropertyDescriptor |
getPropertyDescriptor(Object src,
PropertyPath.Path path)
returns the property associated with the given path, null if a problem occurred. |
static PropertyDescriptor |
getPropertyDescriptor(Object src,
String path)
returns the property associated with the given path |
String |
getRevision()
Returns the revision string. |
static Object |
getValue(Object src,
PropertyPath.Path path)
returns the value specified by the given path from the object |
static Object |
getValue(Object src,
String path)
returns the value specified by the given path from the object |
static void |
main(String[] args)
for testing only |
static boolean |
setValue(Object src,
PropertyPath.Path path,
Object value)
set the given value specified by the given path in the object |
static void |
setValue(Object src,
String path,
Object value)
set the given value specified by the given path in the object |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyPath()
Method Detail |
---|
public static weka.core.PropertyPath.PropertyContainer find(Object src, PropertyPath.Path path)
src
- the object to start frompath
- the path to follow
public static PropertyDescriptor getPropertyDescriptor(Object src, PropertyPath.Path path)
src
- the object to start frompath
- the path to follow
public static PropertyDescriptor getPropertyDescriptor(Object src, String path)
src
- the object to start frompath
- the path to follow
public static Object getValue(Object src, PropertyPath.Path path)
src
- the object to work onpath
- the retrieval path
public static Object getValue(Object src, String path)
src
- the object to work onpath
- the retrieval path
public static boolean setValue(Object src, PropertyPath.Path path, Object value)
src
- the object to work onpath
- the retrieval pathvalue
- the value to set
public static void setValue(Object src, String path, Object value)
src
- the object to work onpath
- the retrieval pathvalue
- the value to setpublic String getRevision()
getRevision
in interface RevisionHandler
public static void main(String[] args) throws Exception
args
- the commandline options - ignored
Exception
- if something goes wrong
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |