RingConnection

RingConnection

A class representing a ring connection.

Constructor

new RingConnection(firstRing, secondRing)

Source:
Properties:
Name Type Description
id Number

The id of this ring connection.

firstRingId Number

A ring id.

secondRingId Number

A ring id.

vertices Set.<Number>

A set containing the vertex ids participating in the ring connection.

The constructor for the class RingConnection.

Parameters:
Name Type Description
firstRing Ring

A ring.

secondRing Ring

A ring.

Methods

(static) getNeighbours(ringConnections, ringId) → {Array.<Number>}

Source:

Retruns the neighbouring rings of a given ring.

Parameters:
Name Type Description
ringConnections Array.<RingConnection>

An array of ring connections containing ring connections associated with the current molecule.

ringId Number

A ring id.

Returns:

An array of ring ids of neighbouring rings.

Type
Array.<Number>

(static) getVertices(ringConnections, firstRingId, secondRingId) → {Array.<Number>}

Source:

Returns an array of vertex ids associated with a given ring connection.

Parameters:
Name Type Description
ringConnections Array.<RingConnection>

An array of ring connections containing ring connections associated with the current molecule.

firstRingId Number

A ring id.

secondRingId Number

A ring id.

Returns:

An array of vertex ids associated with the ring connection.

Type
Array.<Number>

(static) isBridge(ringConnections, vertices, firstRingId, secondRingId) → {Boolean}

Source:

Checks whether or not two rings are connected by a bridged bond.

Parameters:
Name Type Description
ringConnections Array.<RingConnection>

An array of ring connections containing the ring connections associated with the current molecule.

vertices Array.<Vertex>

An array of vertices containing the vertices associated with the current molecule.

firstRingId Number

A ring id.

secondRingId Number

A ring id.

Returns:

A boolean indicating whether or not two rings ar connected by a bridged bond.

Type
Boolean

addVertex(vertexId)

Source:

Adding a vertex to the ring connection.

Parameters:
Name Type Description
vertexId Number

A vertex id.

containsRing(ringId) → {Boolean}

Source:

Returns a boolean indicating whether or not a ring with a given id is participating in this ring connection.

Parameters:
Name Type Description
ringId Number

A ring id.

Returns:

A boolean indicating whether or not a ring with a given id participates in this ring connection.

Type
Boolean

isBridge(vertices) → {Boolean}

Source:

Checks whether or not this ring connection is a bridge in a bridged ring.

Parameters:
Name Type Description
vertices Array.<Vertex>

The array of vertices associated with the current molecule.

Returns:

A boolean indicating whether or not this ring connection is a bridge.

Type
Boolean

updateOther(ringId, otherRingId)

Source:

Update the ring id of this ring connection that is not the ring id supplied as the second argument.

Parameters:
Name Type Description
ringId Number

A ring id. The new ring id to be set.

otherRingId Number

A ring id. The id that is NOT to be updated.