Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NetworkLinkCollection

Represents the collection of directed links maintained by the {@link com.bayesserver.Network} class. See {@link com.bayesserver.Network#getLinks} . Duplicates and null values are not allowed.

This collection contains all links in a network. To find links specific to a particular node, see {@link com.bayesserver.Node#getLinksIn LinksIn} and {@link com.bayesserver.Node#getLinksOut LinksOut}.

see

com.bayesserver.Node#getLinksIn

see

com.bayesserver.Node#getLinksOut

Hierarchy

  • NetworkLinkCollection

Implements

Index

Constructors

constructor

Accessors

isReadOnly

  • get isReadOnly(): boolean
  • Gets a value indicating whether the collection read-only. Always returns false;

    Returns boolean

network

  • Gets the {@link com.bayesserver.Network} the collection belongs to.

    Returns Network

size

  • get size(): number
  • Gets the number of elements contained in the collection.

    Returns number

Methods

_2ad2e5f4b2884a52bf8bfc07ce8953d3

  • _2ad2e5f4b2884a52bf8bfc07ce8953d3(): void

__@iterator

  • __@iterator(): Iterator<Link>

clear

  • clear(): void
  • Removes all elements from the collection.

    Returns void

find

  • Finds a link from one node to another if it exists, otherwise returns null.

    Parameters

    • from: Node

      The from (parent) node.

    • to: Node

      The to (child) node.

    Returns Link

    The link if found, otherwise null.

  • Finds a link from one node to another if it exists, otherwise returns null.

    Parameters

    • from: Node

      The from (parent) node.

    • to: Node

      The to (child) node.

    • temporalOrder: number

      The temporal order of the link. Will be null unless the nodes are temporal nodes.

    Returns Link

    The link if found, otherwise null.

get

  • get(index: number): Link
  • Gets the {@link com.bayesserver.Link} object at the specified index.

    exception

    ReferenceError Raised when value being set is null.

    exception

    Error Raised if the value being set already belongs to a network, an equivalent link already exists, or the link nodes do not belong to the {@link com.bayesserver.Network}.

    exception

    RangeError index is less than 0.-or-index is equal to or greater than the collection count.

    Parameters

    • index: number

      The zero-based index of the {@link com.bayesserver.Link} to find.

    Returns Link

    A {@link com.bayesserver.Link}.

includes

  • includes(item: Link): boolean
  • Determines whether a {@link com.bayesserver.Link} is in the collection. The operation is O(1).

    Parameters

    • item: Link

      The {@link com.bayesserver.Link} to locate in the collection. The value can be null.

    Returns boolean

    true if [item] is found in the collection; otherwise, false.

indexOf

  • indexOf(item: Link): number
  • Determines the index of a specific {@link com.bayesserver.Link} in the collection. This operation is O(1).

    Parameters

    • item: Link

      The link. The value can be null.

    Returns number

    The index of the link or -1 if not found.

insert

  • insert(index: number, item: Link): void
  • Inserts an element into the collection at the specified index.

    exception

    ReferenceError Raised if [item] is null.

    exception

    Error Raised if the new link already belongs to a network, an equivalent link already exists, or the link nodes do not belong to the {@link com.bayesserver.Network}.

    exception

    RangeError index is less than 0.-or-index is equal to or greater than the collection count.

    Parameters

    • index: number

      The zero based index at which to add the element.

    • item: Link

      The item to insert. Cannot be null.

    Returns void

push

  • push(...items: Link[]): number
  • Parameters

    • Rest ...items: Link[]

    Returns number

remove

  • remove(item: Link): boolean
  • Removes the {@link com.bayesserver.Link} from the collection.

    exception

    ReferenceError Raised if [item] is null.

    Parameters

    • item: Link

      The {@link com.bayesserver.Link} to be removed from the collection.

    Returns boolean

    true if item was successfully removed from the collection; otherwise, false. This method also returns false if item is not found in the collection.

removeAt

  • removeAt(index: number): Link
  • Removes an element from the collection at the specified index.

    exception

    RangeError index is less than 0.-or-index is equal to or greater than the collection count.

    Parameters

    • index: number

      The zero based index at which to remove the element.

    Returns Link

set

  • set(index: number, value: Link): void
  • Sets the {@link com.bayesserver.Link} object at the specified index.

    exception

    ReferenceError Raised when value being set is null.

    exception

    Error Raised if the value being set already belongs to a network, an equivalent link already exists, or the link nodes do not belong to the {@link com.bayesserver.Network}.

    exception

    RangeError index is less than 0.-or-index is equal to or greater than the collection count.

    Parameters

    • index: number

      The zero-based index of the {@link com.bayesserver.Link} to find.

    • value: Link

    Returns void