Skip to main content

class GraphEmpty<N,V,Tp,TpG>

undocumented

Extends: GraphEmptyBase

Implements: GraphBase<N,Tp>

Type parameters​

NameConstraintsDefaultDescription
Nundocumented
Vundocumented
TpGraphTypesContextImplundocumented
TpGWithGraphValues<Tp, N, V>WithGraphValues<Tp, N, V>undocumented

Properties​

_NonEmptyType​

undocumented

Definition​

_NonEmptyType: TpG['nonEmpty'];

Overrides​

EmptyBase._NonEmptyType

connectionSize​

undocumented

context​

undocumented

Definition​

readonly context: TpG['context'];

Overrides​

GraphBase.context

isDirected​

undocumented

Definition​

readonly isDirected: boolean;

Overrides​

VariantGraphBase.isDirected

isEmpty​

Returns true since the collection is empty.

Definition​

get isEmpty(): true;

Overrides​

EmptyBase.isEmptyVariantGraphBase.isEmpty

length​

Returns 0 for the length of the collection.

Definition​

get length(): 0;

Overrides​

EmptyBase.length

linkMap​

undocumented

Definition​

get linkMap(): TpG['linkMap'];

Overrides​

GraphBase.linkMap

nodeSize​

undocumented

Definition​

get nodeSize(): 0;

Overrides​

GraphEmptyBase.nodeSizeVariantGraphBase.nodeSize

size​

Returns 0 for the size of the collection.

Definition​

get size(): 0;

Overrides​

EmptyBase.size

Methods​

[Symbol.iterator]​

Returns an empty iterator.

addNode​

undocumented

Definition​

addNode(node: N): TpG['nonEmpty'];

Parameters​

NameTypeDescription
nodeN

Overrides​

GraphConnect.addNode

addNodes​

undocumented

Definition​

addNodes(nodes: StreamSource<N>): WithGraphValues<Tp, N, V>['nonEmpty'];

Parameters​

NameTypeDescription
nodesStreamSource<N>

Overrides​

GraphConnect.addNodes

assumeNonEmpty​

Throws a RimbuError.EmptyCollectionAssumedNonEmptyError, since the collection is empty.

Definition​

assumeNonEmpty(): never;

throws

RimbuError.EmptyCollectionAssumedNonEmptyError

Overrides​

EmptyBase.assumeNonEmpty, VariantGraphBase.assumeNonEmpty

connect​

undocumented

Definition​

connect(node1: N, node2: N): TpG['nonEmpty'];

Parameters​

NameTypeDescription
node1N
node2N

Overrides​

GraphBase.connect

connectAll​

undocumented

Definition​

connectAll(links: StreamSource<WithGraphValues<Tp, N, V>['link']>): WithGraphValues<Tp, N, V>['nonEmpty'];

Parameters​

NameTypeDescription
linksStreamSource<WithGraphValues<Tp, N, V>['link']>

Overrides​

GraphConnect.connectAll

disconnect​

undocumented

Definition​

disconnect(): any;

Overrides​

GraphEmptyBase.disconnect, VariantGraphBase.disconnect

disconnectAll​

undocumented

filter​

Returns this, since filtering an empty collection is still empty.

Definition​

filter(): any;

Overrides​

EmptyBase.filter

forEach​

Performs no action, since there are no elements.

Definition​

forEach(): void;

Overrides​

EmptyBase.forEach, VariantGraphBase.forEach

getConnectionsFrom​

undocumented

Definition​

getConnectionsFrom(): TpG['linkConnections'];

Overrides​

GraphBase.getConnectionsFrom

getConnectionStreamFrom​

undocumented

getConnectionStreamTo​

undocumented

hasConnection​

undocumented

Definition​

hasConnection(): false;

Overrides​

GraphEmptyBase.hasConnection, VariantGraphBase.hasConnection

hasNode​

undocumented

Definition​

hasNode(): false;

Overrides​

GraphEmptyBase.hasNode, VariantGraphBase.hasNode

isSink​

undocumented

Definition​

isSink(): false;

Overrides​

GraphEmptyBase.isSink

isSource​

undocumented

Definition​

isSource(): false;

Overrides​

GraphEmptyBase.isSource

nonEmpty​

Returns false, keeping the type narrowed to the empty variant.

Definition​

nonEmpty(): this is this['_NonEmptyType'];

Overrides​

EmptyBase.nonEmpty, VariantGraphBase.nonEmpty

remove​

Returns this, since removing from an empty collection has no effect.

Definition​

remove(): any;

Overrides​

EmptyBase.remove

removeNode​

undocumented

Definition​

removeNode(): any;

Overrides​

GraphEmptyBase.removeNode, VariantGraphBase.removeNode

removeNodes​

undocumented

Definition​

removeNodes(): any;

Overrides​

GraphEmptyBase.removeNodes, VariantGraphBase.removeNodes

removeUnconnectedNodes​

undocumented

stream​

Returns an empty Stream.

Definition​

stream(): Stream<any>;

Overrides​

EmptyBase.stream, VariantGraphBase.stream

streamConnections​

undocumented

streamNodes​

undocumented

toArray​

Returns an empty array.

Definition​

toArray(): [];

Overrides​

EmptyBase.toArray

toBuilder​

undocumented

Definition​

toBuilder(): TpG['builder'];

Overrides​

GraphBase.toBuilder

toJSON​

undocumented

Definition​

toJSON(): ToJSON<any[]>;

Overrides​

VariantGraphBase.toJSON

toString​

undocumented

Definition​

toString(): string;

Overrides​

VariantGraphBase.toString