true if any source end of this edge fulfills pred.
true if node is a source of this edge.
true if node is a source of this edge. In case this edge is undirected this method maps to isAt.
true if any target end of this edge fulfills pred.
true if node is a target of this edge.
true if node is a target of this edge. In case this edge is undirected this method maps to isAt.
true if any end of this edge fulfills pred.
true if node is incident with this edge.
A function to determine whether the arity of the passed Product
of nodes (that is the number of edge ends) is valid.
A function to determine whether the arity of the passed Product
of nodes (that is the number of edge ends) is valid.
This function is called on every edge-instantiation
by validate that throws EdgeException if this method returns false.
Iterator for the nodes (end-points) of this edge.
Iterator for the nodes (end-points) of this edge.
true if
a) two distinct ends of this undirected edge exist
for which p1 and p2 hold or
b) p1 holds for a source and p2 for a target of this directed edge.
true if
a) both n1 and n2 are at this edge for an undirected edge
b) n1 is a source and n2 a target of this edge for a directed edge.
The end nodes joined by this edge.
The end nodes joined by this edge.
Nodes will typically be represented by Tuples. Alternatively subclasses of Iterable
implementing Product, such as List, may also be used.
In the latter case be aware of higher memory footprint.
Applies f to the source end resp.
Applies f to the source end resp. to all source ends of this edge.
Applies f to the target end resp.
Applies f to the target end resp. to all target ends of this edge.
The first node.
The first node. Same as _n(0).
The second node.
The second node. Same as _n(1).
The n'th node with 0 <= n < arity.
Number of nodes linked by this Edge.
Number of nodes linked by this Edge. At least two nodes are linked. In case of a hook, the two nodes are identical. Hyper-edges may link more than two nodes.
Same as isAt.
Same as isAt.
true it this edge is directed.
Preconditions:
this.directed == that.directed &&
this.isInstanceOf[Keyed] == that.isInstanceOf[Keyed]
Preconditions:
this.directed == that.directed &&
this.isInstanceOf[Keyed] == that.isInstanceOf[Keyed]
Same as directed.
Same as directed.
true if this is a hyperedge that is it may have more than two ends.
true if this edge is labeled.
true if this edge is labeled. See also label.
true if this edge produces a self-loop.
true if this edge produces a self-loop.
In case of a non-hyperedge, a loop is given if the incident nodes are equal.
In case of a directed hyperedge, a loop is given if the source is equal to
any of the targets.
In case of an undirected hyperedge, a loop is given if any pair of incident
nodes has equal nodes.
Same as undirected.
Same as undirected.
This method may be overridden to enforce additional validation at edge creation time.
This method may be overridden to enforce additional validation at edge
creation time. Be careful to call super.isValidCustom when overriding.
This function is called on every edge-instantiation
by validate that throws EdgeException if this method returns false.
The label of this edge.
The label of this edge. If Graph's edge type parameter has been inferred or set
to a labeled edge type all contained edges are labeled. Otherwise you should
assert, for instance by calling isLabeled, that the edge instance is labeled
before calling this method.
Note that label is normally not part of the edge key (hashCode) meaning that
edges of different labels connecting the same nodes will be treated as equal
and not added more than once. If you need multi-edges based on different labels
you should either make use of a predefined key-labeled edge type such as LDiEdge
or define a custom edge class that mixes in ExtendedKey and adds label to
keyAttributes.
if the edge is non-labeled.
Sequence of the end points of this edge.
true if this edge has exactly two ends.
true if this edge has exactly two ends.
Same as ! looping.
(Changed in version 2.9.0) The behavior of scanRight has changed. The previous behavior can be reproduced with scanRight.reverse.
(Changed in version 2.9.0) transpose throws an IllegalArgumentException if collections are not uniformly sized.
true it this edge is undirected.
true it this edge is undirected.
Performs basic, inevitable edge validation.
Performs basic, inevitable edge validation. Among others, ensures
that nodes ne null and no edge end eq null.
This validation method must be called in the constructor of any edge class
that directly extends or mixes in EdgeLike. To perform additional custom
validation isValidCustom is to be overridden.
if any of the basic validations or of eventually supplied additional validations fails.
The weight of this edge defaulting to 1L.
The weight of this edge defaulting to 1L.
Note that weight is normally not part of the edge key (hashCode) meaning that
edges of different weights connecting the same nodes will be treated as equal
and not added more than once. If you need multi-edges based on different weights
you should either make use of a predefined key-weighted edge type such as WDiEdge
or define a custom edge class that mixes in ExtendedKey and adds weight to
keyAttributes.
In case of weights of a type other than Long you either convert values of
that type to Long prior to edge creation or define a custom edge class
to include your own val of that type and override def weight to provide
a conversion.
(edgeLike: MonadOps[N]).filter(p)
(edgeLike: MonadOps[N]).flatMap(f)
(edgeLike: MonadOps[N]).map(f)
(edgeLike: MonadOps[N]).withFilter(p)
Template for Edges in a Graph.
Implementation note: Irrespective of the containing
Graphall library-provided Edges are immutable.the user type of the nodes (ends) of this edge.