Add inbound edges nodeIds
into the inbound list.
Add outbound edges nodeId
into the outbound list
The unique id of this node.
The unique id of this node.
Returns ids of all nodes pointing to this node.
Returns ids of all nodes pointing to this node.
all nodes this node points to.
Remove a single edge nodeId
from the inbound list.
Remove a single edge nodeId
from the outbound list.
Add single inbound edge nodeId
into the inbound list
Add single outbound edge nodeId
into the outbound list
The default implementation just walks the array but users likely want to override to provide a more optimized implementation.
The default implementation just walks the array but users likely want to override to provide a more optimized implementation.
a boolean indicating Whether nodeIds
contains queryNodeId
.
the total number of inbound edges.
Returns up to max
nodes that this node points to.
Returns up to max
nodes that this node points to.
the max number of nodes it needs
a sequence of inboundNode ids
Intersection of dir
neighbors with nodeIds
.
Returns true
if the given nodeId
points to this node.
Returns true
if the given nodeId
points to this node.
host node id
a set of random node id
whether nodeId
is a neighbor in the allowing direction dir
whether nodeId
is a neighbor in the allowing direction dir
the direction (inbound or outbound) that the method is applied to.
the target node id.
a boolean indicating whether nodeId
is in the home node's neighbors.
Returns true
if the this node point to the given node
.
Returns true
if the this node point to the given node
.
home node id
a boolean indicating whether outbound nodes contains nodeId
.
the neighbor count in the allowing direction dir
the neighbor count in the allowing direction dir
the direction (inbound or outbound) that the method is applied to.
the number of neighbors in the direction of dir
.
A method that returns max
nodes of either inbound or outbound
allowing direction dir
.
A method that returns max
nodes of either inbound or outbound
allowing direction dir
.
the direction (inbound or outbound) that the method is applied to.
the maximum number of neighbors needed.
a sequence of inbound or outbound neighbors.
A method that return either inbound or outbound allowing direction dir
.
A method that return either inbound or outbound allowing direction dir
.
the direction (inbound or outbound) that the method is applied to.
a sequence of inbound or outbound neighbors.
the total number of outbound edges.
the maximum number of outBound nodes needed.
up to max
nodes that this node points to.
Returns a random node from the set of nodes that points to this node or else None
if
this node has no inbound edges, using the supplied random number generator rnd
.
Returns a random node from the set of nodes that points to this node or else None
if
this node has no inbound edges, using the supplied random number generator rnd
.
user defined random number generator
a random node id
Returns a random node from the set of nodes that points to this node or else None
if
this node has no inbound edges.
Returns a random node from the set of nodes that points to this node or else None
if
this node has no inbound edges.
The default implementation picks a random node from inboundNodes()* so subclasses
should consider overriding this method if the Seq
sequence they produce is not
a IndexedSeq
.
a sequence of random node ids
Returns a random sample of size at most numResults
from the set of nodes
that point to this node using the supplied random number generator rnd
.
Returns a random sample of size at most numResults
from the set of nodes
that point to this node using the supplied random number generator rnd
.
max number of random nodes needed
user defined random number generator
a set of random node id
A method that returns a random node in the allowing direction dir
,
using the supplied random number generator rnd
.
A method that returns a random node in the allowing direction dir
,
using the supplied random number generator rnd
.
the direction (inbound or outbound) that the method is applied to.
a user defined random number generator.
a random neighbor or None
if no neighbor is in the direction dir
.
A method that returns a random node in the allowing direction dir
.
A method that returns a random node in the allowing direction dir
.
the direction (inbound or outbound) that the method is applied to.
a random neighbor or None
if no neighbor is in the direction dir
.
A method that returns a set of either inbound or outbound nodes of size numResults
,
in the allowing direction dir
, using the supplied random number
generator rnd
.
A method that returns a set of either inbound or outbound nodes of size numResults
,
in the allowing direction dir
, using the supplied random number
generator rnd
.
maximum number of neighbors needed.
the direction (inbound or outbound) that the method is applied to.
a user defined random number generator.
a set of random neighbors.
A method that returns a random node of size numResults
in the allowing direction dir
,
using the supplied random number generator rnd
.
A method that returns a random node of size numResults
in the allowing direction dir
,
using the supplied random number generator rnd
.
maximum number of neighbors needed.
the direction (inbound or outbound) that the method is applied to.
a set of random neighbors.
a user defined random number generator.
a random node from nodeIds
using a supplied random number generator rnd
.
Random sampling with replacement.
Random sampling with replacement. Choose a set of random nodes of size numResults
from nodeIds
using a supplied random number generator rnd
.
maximum number of nodes needed.
a user defined random number generator.
a random node from nodeIds
using a supplied random number generator rnd
.
Returns a random node from the set of nodes that this node points to or else None
if
this node has no outbound edges, using the supplied random number generator rnd
.
Returns a random node from the set of nodes that this node points to or else None
if
this node has no outbound edges, using the supplied random number generator rnd
.
a user defined random number generator.
a random node that this node points to.
Returns a random node from the set of nodes that this node points to or else None
if
this node has no outbound edges.
Returns a random node from the set of nodes that this node points to or else None
if
this node has no outbound edges.
The default implementation picks a random node from outboundNodes()* so subclasses
should consider overriding this method if the Seq
sequence they produce is not
a lazy IndexedSeq
.
a random node that this node points to.
Returns a random sample of size at most numResults
from the set of nodes
that this node points to using the supplied random number generator rnd
.
Returns a random sample of size at most numResults
from the set of nodes
that this node points to using the supplied random number generator rnd
.
a user defined random number generator.
a set of random nodes that this node points to.
Override toString to make debugging easier.
Override toString to make debugging easier. It prints max of 10 neighbors in each direction.
Represents a dynamic node in a directed graph. DynamicNode can add and delete its in and out edges dynamically.