Type Parameters

Hierarchy

  • Class<D, S>
    • Class

Accessors

  • get codirectedEdges(): EdgeCollection<this, D, S>
  • Returns EdgeCollection<this, D, S>

    The edges that connect the same nodes as this edge. Direction is taken into account.

  • get data(): D
  • Use the data object for JSON serializable data. For temporary or non-serializable data, use BaseEdge.Class.scratchData.

    Returns D

    the data object associated with this edge.

  • get graph(): Class<Data, ScratchData>
  • Returns Class<Data, ScratchData>

    the graph that this edge is a part of.

  • get id(): string
  • Returns string

    the unique identifier of this edge.

  • get isFake(): boolean
  • Returns boolean

    Whether this edge is ControlFlowEdge.Data.isFake | fake.

  • set isFake(value): void
  • Sets whether this edge is ControlFlowEdge.Data.isFake | fake.

    Parameters

    • value: boolean

      Whether this edge is fake.

    Returns void

  • get isLoop(): boolean
  • Returns boolean

    whether this edge is a loop (source and target are the same node).

  • get isRemoved(): boolean
  • Returns boolean

    whether this edge has been removed from the graph.

  • get parallelEdges(): EdgeCollection<this, D, S>
  • Returns EdgeCollection<this, D, S>

    The edges that connect the same nodes as this edge. Direction is not taken into account.

  • get scratchData(): S
  • Use the scratch data object for temporary or non-serializable data. For JSON serializable data, use BaseEdge.Class.data.

    The scratch data is stored under the Graph.scratchNamespace | @specs-feup/flow namespace.

    Returns S

    the scratch data object associated with this edge.

  • get source(): Class<Data, ScratchData>
  • Returns Class<Data, ScratchData>

    the source node of this edge.

  • set source(node): void
  • Changes the source node of this edge.

    Parameters

    • node: Class<Data, ScratchData>

      The new source node.

    Returns void

  • get target(): Class<Data, ScratchData>
  • Returns Class<Data, ScratchData>

    the target node of this edge.

  • set target(node): void
  • Changes the target node of this edge.

    Parameters

    • node: Class<Data, ScratchData>

      The new target node.

    Returns void

Methods

  • Changes the functionality class of the current edge. This is only possible if the data and scratch data are compatible with the new class. To assert that, use BaseEdge.Class.is.

    Type Parameters

    • E extends Class<D, S>

    Parameters

    • EdgeType: {
          Class: Class<D, S, E>;
      }

      The edge type to change the functionality class into.

      • Class: Class<D, S, E>

    Returns E

    The same edge, wrapped in the new functionality class.

  • Changes the functionality class of the current edge. Should only be used when it is known (but not statically provable) that the edge is compatible with the new class. If not, an error will be thrown.

    It is bad practice to try and catch the error thrown by this function. For such cases, combine BaseEdge.Class.is with BaseEdge.Class.as, or use BaseEdge.Class.switch instead.

    Type Parameters

    • D2 extends Data
    • S2 extends ScratchData
    • E2 extends Class<D2, S2>

    Parameters

    • EdgeType: Edge<D2, S2, E2>

      The edge type to change the functionality class into.

    • Optionalmessage: string

      The message to throw if the edge is not compatible with the type.

    Returns E2

    The edge, wrapped in the new functionality class.

    LaraFlowError if the edge is not compatible with the type. This error should be seen as a logic error and not catched.

  • Initializes the edge with the information of a builder. This is effectively extends the type of the edge to include the data and scratch data of the builder.

    The same edge may simultaneously be of multiple types, as long as the data and scratch data are compatible with the types. The builder methods may overwrite data and scratch data fields with names that collide with its type's fields.

    Type Parameters

    • D2 extends Data
    • S2 extends ScratchData

    Parameters

    • builder: Builder<D2, S2, D, S>

      The builder to use to initialize the edge.

    Returns Class<D2, S2>

    The same edge, with the data and scratch data of the builder. The edge is downcasted to BaseEdge.Class because the builder may overwrite the data and scratch data fields, invalidating the current type.

  • Checks if this edge's data and scratch data are compatible with a specific type. This is effectively a type guard function.

    Type Parameters

    • D2 extends Data
    • S2 extends ScratchData
    • E2 extends Class<D2, S2>

    Parameters

    • EdgeType: Edge<D2, S2, E2>

      The edge type to check compatibility with.

    Returns this is Class<D2, S2>

    Whether the edge is compatible with the given type.

  • Removes this edge from the graph.

    Returns void

  • Restores this edge if it has been removed. See BaseEdge.Class.remove.

    Returns void

  • Checks if the type of the edge is compatible with several types, calling a callback for the first match. See Edge.Case for the syntax of each case.

    For a default case, match with BaseEdge, which will always be compatible with any edge type.

    Parameters

    • Rest...cases: {
          callback: ((g: any) => void);
          EdgeType: Edge<any, any, any>;
      }[]

      The cases to match against.

    Returns void

  • Returns EdgeCollection<ConditionalEdge.Class<D, S>, D, S>

    A collection containing only this edge.

  • Returns EdgeSingular

    the underlying cytoscape edge object.

  • Tries to change the functionality class of the current edge. If the edge is not compatible with the new class, undefined is returned.

    Type Parameters

    • D2 extends Data
    • S2 extends ScratchData
    • E2 extends Class<D2, S2>

    Parameters

    • EdgeType: Edge<D2, S2, E2>

      The edge type to change the functionality class into.

    Returns undefined | E2

    The edge, wrapped in the new functionality class, or undefined if the edge is not compatible with the type.