- 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 String
first(GraphPath path)
Returns the first element of the pathstatic String
last(GraphPath path)
Returns the last element of the pathstatic GraphPath
parse(String pathString)
De-serializes a path from the given string.static GraphPath
path(String name)
Create a path containing a single name.static GraphPath
path(String... names)
Create a path containing the given sequence of names.static GraphPath
remainder(GraphPath path)
Returns aGraphPath
consisting 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 aGraphPath
consisting 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
names
in their original order
-
-