|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnesstar.api.PathIterator
public class PathIterator
An iterator on a path. A path is a, possibly empty, sequence of path steps each one representing a property traversal. For example .children[1].variables[2] is a path composed by two steps. The first represent the traversal of the children property that returns a collection of elements followed by the extraction of the first element of the returned collection. In API terms this would translate to the expression: context.getChildren().get(1). The context is the object with respect to which the path is defined. If the path derives from a query then the context would be the queried object (e.g., a catalog)
| Constructor Summary | |
|---|---|
PathIterator(RDFObject obj)
|
|
PathIterator(String path)
Create a path iterator on the given path |
|
| Method Summary | |
|---|---|
static void |
dbg(String msg)
Method |
static int |
getIndex(String step)
|
String |
getPath()
|
static PathIterator[] |
getPathIterators(String paths)
|
static String |
getProperty(String step)
|
Object |
nextObj(Object context)
Apply the current traversal element to the context object |
String |
nextStep()
|
Object |
traversePath(Object context)
Traverse the path starting from the given context and return the result object Useful for testing and as an example of path traversal |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PathIterator(RDFObject obj)
throws Exception
an - object with an iniatialised 'path' property
Exceptionpublic PathIterator(String path)
path - | Method Detail |
|---|
public static PathIterator[] getPathIterators(String paths)
paths - a ";" separate list of paths as returned by the PathsTo operations (e.g. Study2.PathsTo(nesstar.rdf.RDFObject)).
public static String getProperty(String step)
step - the step, e.g.: children[3]
public static int getIndex(String step)
step - the step, e.g.: children[3]
public static void dbg(String msg)
msg - public String getPath()
public String nextStep()
public Object nextObj(Object context)
throws Exception
context - the object to which the traversal is to be applied
Exception
public Object traversePath(Object context)
throws Exception
context -
Exception
|
Nesstar SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||