Home Reference Source Repository
import Identifier from 'lseqtree/lib/identifier.js'
public class | source

Identifier

Unique and immutable identifier composed of digit, sources, counters.

Constructor Summary

Public Constructor
public

constructor(base: Base, digits: Number[], sites: Object[], counters: Number[])

Member Summary

Private Members
private

_base: *

private

_c: *

private

_d: *

private

_s: *

Method Summary

Public Methods
public

compareTo(o: Identifier): Integer

Compare two identifiers.

public

Set the d,s,c values according to the node in argument

public

Convert the identifier into a node without element.

Public Constructors

public constructor(base: Base, digits: Number[], sites: Object[], counters: Number[]) source

Params:

NameTypeAttributeDescription
base Base

The base of identifiers.

digits Number[]

The digit (position in dense space).

sites Object[]

The list of sources.

counters Number[]

The list of counters.

Private Members

private _base: * source

private _c: * source

private _d: * source

private _s: * source

Public Methods

public compareTo(o: Identifier): Integer source

Compare two identifiers.

Params:

NameTypeAttributeDescription
o Identifier

The other identifier.

Return:

Integer

1 if this is lower, 0 if they are equal, 1 if this is greater.

public fromNode(node: LSeqNode): Identifier source

Set the d,s,c values according to the node in argument

Params:

NameTypeAttributeDescription
node LSeqNode

The lseqnode containing the path in the tree structure.

Return:

Identifier

This identifier modified.

public toNode(e: Object): LSeqNode source

Convert the identifier into a node without element.

Params:

NameTypeAttributeDescription
e Object

The element associated with the node.

Return:

LSeqNode

An LSeqNode containing the element and the path extracted from this identifier.