Skip to main content
Deno 2 is finally here 🎉️
Learn more
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>
extends NonEmptyBase<GraphElement<N>>
Re-export
import { GraphNonEmpty } from "https://deno.land/x/rimbu@1.0.0/graph/custom/index.ts";

Constructors

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

Type Parameters

N
Tp extends GraphTypesContextImpl
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"]
getConnectionStreamFrom<UN = N>(node1: RelatedTo<N, UN>): Stream<Link<N>>
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>>
streamConnections(): Stream<WithGraphValues<Tp, N, any>["link"]>
streamNodes(): Stream.NonEmpty<N>
toBuilder(): TpG["builder"]
toJSON(): ToJSON<[N, [N][]][]>
toString(): string