Skip to main content
Module

x/rimbu/graph/custom/index.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>
Re-export
import { GraphNonEmpty } from "https://deno.land/x/rimbu@0.14.0/graph/custom/index.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