Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NetworkNodeCollection

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

Hierarchy

  • NetworkNodeCollection

Implements

Index

Constructors

constructor

Accessors

network

  • 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<Node>

_svt_x_

  • _svt_x_(p_autogen15: string): void
  • Parameters

    • p_autogen15: string

    Returns void

_svu_x_

  • _svu_x_(p_autogen16: Node, p_autogen17: string, p_autogen18: string): void
  • Parameters

    • p_autogen16: Node
    • p_autogen17: string
    • p_autogen18: string

    Returns void

clear

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

    Returns void

get

  • get(index: number): Node
  • get(name: string): Node
  • get(name: string, throwIfNotFound: boolean): Node
  • Gets the {@link com.bayesserver.Node} 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.

    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.Node} to find.

    Returns Node

    A {@link com.bayesserver.Node}.

  • Performs a case sensitive lookup.

    Parameters

    • name: string

      The name of the {@link com.bayesserver.Node} to find.

    Returns Node

    The {@link com.bayesserver.Node} with the specified name; otherwise null.

  • Performs a case sensitive lookup.

    Parameters

    • name: string

      The name of the {@link com.bayesserver.Node} to find.

    • throwIfNotFound: boolean

      When true throws an exception if the name is not found.

    Returns Node

    The {@link com.bayesserver.Node} with the specified name; otherwise null.

includes

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

    Parameters

    • node: Node

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

    Returns boolean

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

indexOf

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

    Parameters

    • item: Node

      The node. The value can be null.

    Returns number

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

insert

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

    exception

    ReferenceError Raised when [item] is null.

    exception

    Error Raised if the node already belongs to a 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: Node

      The item to insert. Cannot be null.

    Returns void

push

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

    • Rest ...items: Node[]

    Returns number

pushList

  • Adds the [nodes] to the end of the collection.

    exception

    ReferenceError [nodes] collection is null.

    Parameters

    • nodes: IList<Node>

      The collection whose elements should be added. Cannot be null.

    Returns void

remove

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

    exception

    ReferenceError Raised if [item] is null.

    Parameters

    • item: Node

      The {@link com.bayesserver.Node} 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): Node
  • Removes an element from the collection at the specified index, and any links that it has.

    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 Node

set

  • set(index: number, value: Node): void
  • Sets the {@link com.bayesserver.Node} 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.

    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.Node} to find.

    • value: Node

    Returns void