- java.lang.Object
-
- com.pervasive.datarush.graphs.GraphPaths
-
public class GraphPaths extends Object
Factory for generating paths which provides for a standard separator and an escaping mechanism. All names in an path are escaped which ensuresGraphPath.toString()andparse(String)are inverses.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringfirst(GraphPath path)Returns the first element of the pathstatic Stringlast(GraphPath path)Returns the last element of the pathstatic GraphPathparse(String pathString)De-serializes a path from the given string.static GraphPathpath(String name)Create a path containing a single name.static GraphPathpath(String... names)Create a path containing the given sequence of names.static GraphPathremainder(GraphPath path)Returns aGraphPathconsisting of all but the first element of the path
-
-
-
Method Detail
-
first
public static String first(GraphPath path)
Returns the first element of the path- Parameters:
path- the graph path- Returns:
- the first element of the path
-
last
public static String last(GraphPath path)
Returns the last element of the path- Parameters:
path- the graph path- Returns:
- the last element of the path
-
remainder
public static GraphPath remainder(GraphPath path)
Returns aGraphPathconsisting of all but the first element of the path- Parameters:
path- the original path- Returns:
- all but the first element of the path
- Throws:
IllegalArgumentException- if the path does not have at least two elements
-
path
public static final GraphPath path(String name)
Create a path containing a single name.- Parameters:
name- The name to convert to a path- Returns:
- A path consisting only of
name
-
path
public static final GraphPath path(String... names)
Create a path containing the given sequence of names.- Parameters:
names- An array of names to convert to a path- Returns:
- A path consisting of the elements of
namesin their original order
-
-