T
- the type of valuepublic static interface DirectedGraph.Node<T>
Node
interface represents a specific node in this directed
graph.Modifier and Type | Method and Description |
---|---|
void |
add(java.util.stream.Stream<T> dests)
Adds the specified destination nodes if missing and add arcs from this
node to all the destination ones.
|
void |
add(T dest)
Adds the specified destination node if missing and add an arc from this
node to the destination one.
|
void |
addEdge(T dest)
Adds an arc from this node to the destination one.
|
static <T extends Comparable<? super T>> |
comparingByValue()
Gets a comparator that compares
DirectedGraph.Node in natural
order on value. |
static <T> Comparator<DirectedGraph.Node<T>> |
comparingByValue(Comparator<? super T> cmp)
Gets a comparator that compares
DirectedGraph.Node by value using
the given Comparator . |
boolean |
edgeExists(T dest)
Checks if there this node has an edge to another node.
|
java.util.stream.Stream<DirectedGraph.Node<T>> |
edges()
Gets a stream of the edge nodes leaving this node.
|
boolean |
equals(Object o) |
Set<DirectedGraph.Node<T>> |
getEdges()
Gets an immutable view of the edge nodes leaving this node.
|
T |
getValue()
Gets the value for this node.
|
int |
hashCode() |
boolean |
removeEdge(T dest)
Removes the edge from this node to the specified destination node from
the graph.
|
static <T extends Comparable<? super T>> Comparator<DirectedGraph.Node<T>> comparingByValue()
DirectedGraph.Node
in natural
order on value.
The returned comparator is serializable and throws
NullPointerException
when comparing a node with a null value.
T
- the type of elements in this graphDirectedGraph.Node
in natural
order on valueComparable
static <T> Comparator<DirectedGraph.Node<T>> comparingByValue(Comparator<? super T> cmp)
DirectedGraph.Node
by value using
the given Comparator
.
The returned comparator is serializable if the specified comparator is also serializable.
T
- the type of elements in this graphcmp
- the value Comparator
DirectedGraph.Node
by the valueT getValue()
boolean edgeExists(T dest)
dest
- the destination nodetrue
if an edge exists from this node to
dest
; false
otherwiseNoSuchElementException
- if the destination node does not existSet<DirectedGraph.Node<T>> getEdges()
java.util.stream.Stream<DirectedGraph.Node<T>> edges()
void add(T dest)
dest
- the destination nodevoid add(java.util.stream.Stream<T> dests)
dests
- the destination nodesvoid addEdge(T dest)
dest
- the destination nodeNoSuchElementException
- if the destination node does not existboolean removeEdge(T dest)
dest
- the destination nodetrue
if an edge was removed; false
otherwiseNoSuchElementException
- if the destination node does not existint hashCode()
hashCode
in class Object
Object.hashCode()
boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
Copyright (C) 2015-2017 The Helenus Driver Project Authors.