| Package | Description |
|---|---|
| com.mastfrog.graph |
| Modifier and Type | Method and Description |
|---|---|
IntPath |
IntPath.appending(int value)
Create a new path appending the passed value.
|
IntPath |
IntPath.appending(IntPath other)
Create a new IntPath of this one concatenated with another.
|
IntPath |
IntPath.Builder.build()
Create an IntPath from this builder.
|
IntPath |
IntPath.childPath()
Create a new path, lopping off the first element.
|
IntPath |
IntPath.join(IntPath other)
Join this path with another path, prepending or appending depending on
whether this one's start and the other's end are the same, or the other's
start and this one's end are the same.
|
IntPath |
IntPath.join(IntPath other,
boolean eliminateOverlap)
Join this path with another path, if they share a start/end pair, without
duplicating elements; if
eliminateOverlap is passed, then
whichever the latter path is in the result, it will be truncated so as
not to include any elements also present in the other - this is commonly
needed when computing sets of paths that have no partial overlap; returns
null if the start/end pairs of neither match. |
static IntPath |
IntPath.of(Collection<? extends Integer> ints) |
static IntPath |
IntPath.of(int... items)
Create an IntPath from an array of ints.
|
static IntPath |
IntPath.ofUnsafe(int... items)
Create an IntPath from an array of ints, using the passed array directly
rather than copying it.
|
IntPath |
IntPath.parentPath()
Create a new path, lopping off the last element.
|
static IntPath |
IntPath.parse(String val)
Creates an IntPath from a comma-delimited list of integers (which may
contain whitespace), such as the output of
toString(). |
IntPath |
IntPath.prepending(int value)
Create a new path prepending the passed value.
|
IntPath |
IntPath.prepending(IntPath other)
Create a new IntPath of this one concatenated with another.
|
IntPath |
IntPath.reversed()
Create a new path whose elements are this one's in reverse order.
|
IntPath |
IntPath.subPath(int start,
int end)
Get a subpath.
|
IntPath |
ObjectPath.toIntPath()
Get the IntPath underlying this ObjectPath.
|
default IntPath |
IntGraph.topologicalSort(Bits bits)
Topologically sort a set of ints; note that if a graph contains cycles,
topological sorting is impossible - you will get some order that
roughly approximates a topological sort for any ints that are not part of
a cycle; the order of appearance of ints that participate in cycles is
implementation-dependent.
|
default IntPath |
IntGraph.topologicalSort(BitSet bits)
Topologically sort a set of ints; note that if a graph contains cycles,
topological sorting is impossible - you will get some order that
roughly approximates a topological sort for any ints that are not part of
a cycle; the order of appearance of ints that participate in cycles is
implementation-dependent.
|
| Modifier and Type | Method and Description |
|---|---|
List<IntPath> |
IntGraph.pathsBetween(int src,
int target)
Get a list of all paths between the source and target node, sorted low to
high by length.
|
Optional<IntPath> |
IntGraph.shortestPathBetween(int src,
int target)
Get the shortest path between two nodes in the graph.
|
Optional<IntPath> |
IntGraph.shortestUndirectedPathBetween(int src,
int target)
Get the shortest undirected path between two nodes.
|
List<IntPath> |
IntGraph.undirectedPathsBetween(int src,
int target)
Get a list of all inbound and outbound paths between two nodes.
|
| Modifier and Type | Method and Description |
|---|---|
IntPath |
IntPath.appending(IntPath other)
Create a new IntPath of this one concatenated with another.
|
boolean |
IntPath.canJoin(IntPath other)
Returns true if the other path's start is this one's end or vice-versa.
|
int |
IntPath.compareTo(IntPath o) |
boolean |
IntPath.contains(IntPath path)
Determine if this path contains the subsequence in the passed path, or is
equal to it.
|
boolean |
IntPath.endsWith(IntPath other)
Determine if this path ends with (or is equal to) another path.
|
int |
IntPath.firstOverlappingElement(IntPath other)
Returns the index in this IntPath of the first path element also present
in the other, or -1 if there is none.
|
boolean |
IntPath.intersects(IntPath other)
Determine if this IntPath contains some nodes in common with another.
|
IntPath |
IntPath.join(IntPath other)
Join this path with another path, prepending or appending depending on
whether this one's start and the other's end are the same, or the other's
start and this one's end are the same.
|
IntPath |
IntPath.join(IntPath other,
boolean eliminateOverlap)
Join this path with another path, if they share a start/end pair, without
duplicating elements; if
eliminateOverlap is passed, then
whichever the latter path is in the result, it will be truncated so as
not to include any elements also present in the other - this is commonly
needed when computing sets of paths that have no partial overlap; returns
null if the start/end pairs of neither match. |
int |
IntPath.lastOverlappingElement(IntPath other)
Returns the index in this IntPath of the first path element also present
in the other, or -1 if there is none.
|
IntPath |
IntPath.prepending(IntPath other)
Create a new IntPath of this one concatenated with another.
|
boolean |
IntPath.startsWith(IntPath other)
Determine if this path starts with (or is equal to) another path.
|
| Modifier and Type | Method and Description |
|---|---|
int |
IntPath.visitAllSubPaths(int minLength,
Consumer<IntPath> c)
Visit every possible child path of this path which is smaller than this
path but greater than or equal to the passed minimum length.
|
int |
IntPath.visitSubPathsOfLength(int length,
Consumer<IntPath> c)
Visit every possible child path of this path which is smaller than this
path but greater than or equal to the passed minimum length.
|
Copyright © 2010–2021 Mastfrog Technologies. All rights reserved.