Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • TVertex

  • TEdgeData

Hierarchy

  • ClonableAdapter

Implemented by

Index

Methods

Methods

clone

  • clone(vertexCloner?: UnaryOperator<TVertex>, edgeDataCloner?: UnaryOperator<TEdgeData>): CommonAdapter<TVertex, TEdgeData> & ClonableAdapter<TVertex, TEdgeData>
  • Creates an independent copy of this graph data structure. Further changes to this graph are not reflected in the returned copy, and vice-versa.

    All vertices and edges are copied as-is and are not cloned, so that changing the state of a vertex or edge also changes the state of the vertex or edge in the copied graph.

    Optionally you can also pass a function for cloning the vertices and edges.

    Parameters

    • Optional vertexCloner: UnaryOperator<TVertex>

      Clone function that takes a vertex and returns a copy of it.

    • Optional edgeDataCloner: UnaryOperator<TEdgeData>

      Clone function that takes an edge datum and returns a copy of it.

    Returns CommonAdapter<TVertex, TEdgeData> & ClonableAdapter<TVertex, TEdgeData>

    A copy of this graph.

map

  • map<TClonedVertex, TClonedEdgeData>(vertexMapper: TypedFunction<TVertex, TClonedVertex>, edgeDataMapper: TypedFunction<TEdgeData, TClonedEdgeData>): CommonAdapter<TClonedVertex, TClonedEdgeData> & ClonableAdapter<TClonedVertex, TClonedEdgeData>
  • Creates an independent copy of this graph data structure and maps each vertex and edge datum to a new vertex and edge datum. Further changes to this graph are not reflected in the returned copy, and vice-versa.

    The given mapper functions must be reversible, ie. they must map each vertex/edge datum to another one, and each mapped vertex/edge datum may occur only at most once. It is an error to map two different vertices to the same vertex.

    Type parameters

    • TClonedVertex

      Type of the mapped vertices.

    • TClonedEdgeData

      Type of the cloned edge data.

    Parameters

    • vertexMapper: TypedFunction<TVertex, TClonedVertex>

      Mapping function that takes a vertex and returns a mapped copy of it.

    • edgeDataMapper: TypedFunction<TEdgeData, TClonedEdgeData>

      Mapping function that takes an edge datum and returns a mapped copy of it.

    Returns CommonAdapter<TClonedVertex, TClonedEdgeData> & ClonableAdapter<TClonedVertex, TClonedEdgeData>

    A mapped copy of this graph.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc