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

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

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

Constructors

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

Properties

readonly
nodeSize: number

Methods

addNode(node: N): TpG["nonEmpty"]
addNodes(nodes: StreamSource<N>): TpG["nonEmpty"]
asNormal(): any
connect(
node1: N,
node2: N,
value: V,
): TpG["nonEmpty"]
connectAll(links: StreamSource<WithGraphValues<Tp, N, V>["link"]>): TpG["nonEmpty"]
copy(linkMap: TpG["linkMapNonEmpty"], connectionSize: number): TpG["nonEmpty"]
copyE(linkMap: TpG["linkMap"], connectionSize: number): TpG["normal"]
disconnect<UN = N>(node1: RelatedTo<N, UN>, node2: RelatedTo<N, UN>): TpG["nonEmpty"]
disconnectAll<UN = N>(links: StreamSource<Link<RelatedTo<N, UN>>>): TpG["nonEmpty"]
forEach(f: (
index: number,
halt: () => void,
) => void
, options?: { state?: TraverseState; }
): void
getConnectionsFrom<UN = N>(node1: RelatedTo<N, UN>): TpG["linkConnections"]
getValue<UN, O>(
node1: RelatedTo<N, UN>,
node2: RelatedTo<N, UN>,
otherwise?: OptLazy<O>,
): V | O
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 = N>(node: RelatedTo<N, UN>): boolean
mapValues<V2>(mapFun: (
value: V,
node1: N,
node2: N,
) => V2
): WithGraphValues<Tp, N, V2>["nonEmpty"]
modifyAt(
node1: N,
node2: N,
options: { ifNew?: OptLazyOr<V, Token>; ifExists?: ((value: V, remove: Token) => V | Token) | V; },
): TpG["nonEmpty"]
removeNode<UN = N>(node: RelatedTo<N, UN>): TpG["normal"]
removeNodes<UN>(nodes: StreamSource<RelatedTo<N, UN>>): TpG["normal"]
stream(): Stream.NonEmpty<ValuedGraphElement<N, V>>
streamNodes(): Stream.NonEmpty<N>
toBuilder(): TpG["builder"]
toJSON(): ToJSON<[N, (readonly [N, V])[]][]>
toString(): string