Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/graph/custom/non-valued/implementation/non-empty.ts>GraphNonEmpty

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class GraphNonEmpty
implements [GraphBase.NonEmpty]<N, Tp>
import { GraphNonEmpty } from "https://deno.land/x/rimbu@1.0.0/graph/custom/non-valued/implementation/non-empty.ts";

Constructors

new
GraphNonEmpty(
isDirected: boolean,
context: TpG["context"],
linkMap: TpG["linkMapNonEmpty"],
connectionSize: number,
)

Type Parameters

N
optional
TpG extends WithGraphValues<Tp, N, any> = WithGraphValues<Tp, N, any>

Properties

readonly
nodeSize: number

Methods

addNode(node: N): TpG["nonEmpty"]
addNodes(nodes: StreamSource<N>): TpG["nonEmpty"]
asNormal(): any
connect(node1: N, node2: N): TpG["nonEmpty"]
connectAll(links: StreamSource<WithGraphValues<Tp, N, any>["link"]>): TpG["nonEmpty"]
copy(linkMap: TpG["linkMapNonEmpty"], connectionSize: number): TpG["nonEmpty"]
copyE(linkMap: TpG["linkMap"], connectionSize: number): TpG["normal"]
disconnect<UN>(node1: RelatedTo<N, UN>, node2: RelatedTo<N, UN>): TpG["nonEmpty"]
disconnectAll<UN>(links: StreamSource<Link<RelatedTo<N, UN>>>): TpG["nonEmpty"]
forEach(f: (
node: N,
index: number,
halt: () => void,
) => void
, state?: TraverseState
): void
getConnectionsFrom<UN = N>(node1: RelatedTo<N, UN>): TpG["linkConnections"]
getConnectionStreamTo<UN = N>(node: RelatedTo<N, UN>): any
hasConnection<UN = N>(node1: RelatedTo<N, UN>, node2: RelatedTo<N, UN>): boolean
hasNode<UN = N>(node: RelatedTo<N, UN>): boolean
isSink<UN = N>(node: RelatedTo<N, UN>): boolean
isSource<UN>(node: RelatedTo<N, UN>): boolean
removeNode<UN = N>(node: RelatedTo<N, UN>): TpG["normal"]
removeNodes<UN>(nodes: StreamSource<RelatedTo<N, UN>>): TpG["normal"]
stream(): Stream.NonEmpty<GraphElement<N>>
streamNodes(): Stream.NonEmpty<N>
toBuilder(): TpG["builder"]
toJSON(): ToJSON<[N, [N][]][]>
toString(): string