packages/ast-to-mmd/src/app/graph-blocks/for-declaration.graph-block.ts
BaseCycleDeclarationGraphBlock
Properties |
|
Methods |
|
Accessors |
constructor(id: string, body: GraphBlock[], initBlock: GraphBlock, testBlock: GraphBlock, updateBlock: GraphBlock)
|
||||||||||||||||||
Parameters :
|
Private Static CYCLE_COUNTER |
Type : number
|
Default value : 0
|
Inherited from
BaseCycleDeclarationGraphBlock
|
Defined in
BaseCycleDeclarationGraphBlock:6
|
Private cycleID |
Default value : BaseCycleDeclarationGraphBlock.CYCLE_COUNTER++
|
Inherited from
BaseCycleDeclarationGraphBlock
|
Defined in
BaseCycleDeclarationGraphBlock:8
|
Private _lazyDependencies |
Type : string[]
|
Default value : []
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:30
|
Lazy dependencies ready to render when this node is rendered. |
Private _parent |
Type : GraphBlock | undefined
|
Default value : undefined
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:25
|
Parent of current node in graph. Can be undefined. |
Private _parentSiblingCondition |
Type : SiblingCondition
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:39
|
SiblingCondition for finding correct parent. |
Private _siblingCondition |
Type : SiblingCondition
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:35
|
Private Static Readonly EMPTY_LINE_RENDERER_MODIFIER |
Type : LineRendererModifier
|
Default value : () => {...}
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:20
|
Empty implementation of LineRendererModifier. |
Public Readonly id |
Type : string
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:46
|
Unique ID in the node graph.
|
Private Static Readonly POSITIVE_SIBLING_CONDITION |
Type : SiblingCondition
|
Default value : new PositiveSiblingCondition()
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:16
|
Positive sibling condition default for all GraphBlock. |
Private Static Readonly SHAPE_RENDERER |
Type : ShapeRenderer
|
Default value : new ShapeRenderer()
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:12
|
Shape renderer for generating different shapes in graph. |
Protected renderCondition |
renderCondition()
|
Inherited from
BaseCycleDeclarationGraphBlock
|
Defined in
BaseCycleDeclarationGraphBlock:20
|
Returns :
string
|
Protected createLoopLine | ||||||
createLoopLine(builder: LineRenderer)
|
||||||
Inherited from
BaseCycleDeclarationGraphBlock
|
||||||
Defined in
BaseCycleDeclarationGraphBlock:59
|
||||||
Parameters :
Returns :
LineRenderer
|
Public render | ||||||
render(_indent: number)
|
||||||
Inherited from
GraphBlock
|
||||||
Defined in
GraphBlock:19
|
||||||
Parameters :
Returns :
string
|
Protected renderBody | ||||||
renderBody(indent: number)
|
||||||
Inherited from
BaseCycleDeclarationGraphBlock
|
||||||
Defined in
BaseCycleDeclarationGraphBlock:55
|
||||||
Parameters :
Returns :
string
|
Protected renderDependencies | ||||||
renderDependencies(_indent: number)
|
||||||
Inherited from
BlockDeclarationGraphBlock
|
||||||
Defined in
BlockDeclarationGraphBlock:35
|
||||||
Parameters :
Returns :
string
|
Protected renderOuterBody | ||||||
renderOuterBody(indent: number)
|
||||||
Inherited from
BaseCycleDeclarationGraphBlock
|
||||||
Defined in
BaseCycleDeclarationGraphBlock:28
|
||||||
Parameters :
Returns :
string
|
Protected createLineBuilder |
createLineBuilder(lhsId: string, rhsId: string)
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:71
|
Returns :
LineRenderer
|
Protected renderChildren | |||||||||
renderChildren(indent: number, children: GraphBlock[])
|
|||||||||
Inherited from
BlockDeclarationGraphBlock
|
|||||||||
Defined in
BlockDeclarationGraphBlock:64
|
|||||||||
Parameters :
Returns :
string
|
Private __multiFindChildIndex | ||||||||||||
__multiFindChildIndex(children: GraphBlock[][], child: GraphBlock)
|
||||||||||||
Inherited from
GraphBlock
|
||||||||||||
Defined in
GraphBlock:575
|
||||||||||||
Private method for finding a child index of defined block in a multidimensional array of children.
Parameters :
Returns :
| undefined
Coordinates of child block or undefined when block is not found. |
Private __renderLines | ||||||||||||||||||||||||
__renderLines(indent: number, id: string, ids: string[], direction: "left" | "right", builderModifier: LineRendererModifier[])
|
||||||||||||||||||||||||
Inherited from
GraphBlock
|
||||||||||||||||||||||||
Defined in
GraphBlock:546
|
||||||||||||||||||||||||
Private method for rendering lines between nodes in defined directions.
Parameters :
Returns :
string
Rendered line. |
Protected _assignParent | ||||||||
_assignParent(children: GraphBlock[])
|
||||||||
Inherited from
GraphBlock
|
||||||||
Defined in
GraphBlock:289
|
||||||||
Helper method for assigning this parent into each children.
Parameters :
Returns :
void
|
Protected _filterChildren | ||||||||
_filterChildren(children: GraphBlock[])
|
||||||||
Inherited from
GraphBlock
|
||||||||
Defined in
GraphBlock:466
|
||||||||
Helper method for filtering array of children.
Parameters :
Returns :
GraphBlock[]
|
Protected _findParentBySiblingCondition | ||||||||||||
_findParentBySiblingCondition(child: GraphBlock, siblingCondition: SiblingCondition)
|
||||||||||||
Inherited from
GraphBlock
|
||||||||||||
Defined in
GraphBlock:521
|
||||||||||||
Helper method for finding an indirect parent of defined child by SiblingCondition.
Parameters :
Returns :
GraphBlock | undefined
|
Protected _findSiblingChild | ||||||||||||||||||||
_findSiblingChild(child: GraphBlock, parentSiblingCondition: SiblingCondition, siblingCondition: SiblingCondition)
|
||||||||||||||||||||
Inherited from
GraphBlock
|
||||||||||||||||||||
Defined in
GraphBlock:478
|
||||||||||||||||||||
Helper method for finding a sibling of defined child in parents children.
Parameters :
Returns :
GraphBlock | undefined
|
Protected _generateSpace | ||||||||
_generateSpace(count: number)
|
||||||||
Inherited from
GraphBlock
|
||||||||
Defined in
GraphBlock:301
|
||||||||
Helper method for generating space.
Parameters :
Returns :
string
Space of defined length. |
Protected _multiFilterChildren | ||||||||
_multiFilterChildren(children: GraphBlock[][])
|
||||||||
Inherited from
GraphBlock
|
||||||||
Defined in
GraphBlock:456
|
||||||||
Helper method for filtering children in multidimensional array of children.
Parameters :
Returns :
[][]
|
Protected _renderConnectionWithParent | |||||||||||||||
_renderConnectionWithParent(indent: number, children: GraphBlock, lastIds: string[], priorityBuilderModifier: LineRendererModifier[])
|
|||||||||||||||
Inherited from
GraphBlock
|
|||||||||||||||
Defined in
GraphBlock:410
|
|||||||||||||||
Parameters :
Returns :
string
|
Protected _renderDependencies | ||||||||||||
_renderDependencies(indent: number, blocks: GraphBlock[])
|
||||||||||||
Inherited from
GraphBlock
|
||||||||||||
Defined in
GraphBlock:346
|
||||||||||||
Helper method for rendering dependencies with defined indent between blocks.
Parameters :
Returns :
string
Dependencies of blocks. |
Protected _renderLine | ||||||||||||||||||||
_renderLine(indent: number, lhsId: string, rhsId: string, builderModifier: LineRendererModifier[])
|
||||||||||||||||||||
Inherited from
GraphBlock
|
||||||||||||||||||||
Defined in
GraphBlock:314
|
||||||||||||||||||||
Helper method for generating line between two nodes.
Parameters :
Returns :
string
Line definition between two nodes. |
Protected _renderLinesL2R | ||||||||||||||||||||
_renderLinesL2R(indent: number, toId: string, fromIds: string[], builderModifier: LineRendererModifier[])
|
||||||||||||||||||||
Inherited from
GraphBlock
|
||||||||||||||||||||
Defined in
GraphBlock:383
|
||||||||||||||||||||
Helper method for rendering line starting in one node and ending in multiple nodes.
Parameters :
Returns :
string
Rendered line. |
Protected _renderLinesR2L | ||||||||||||||||||||
_renderLinesR2L(indent: number, fromId: string, toIds: string[], builderModifier: LineRendererModifier[])
|
||||||||||||||||||||
Inherited from
GraphBlock
|
||||||||||||||||||||
Defined in
GraphBlock:401
|
||||||||||||||||||||
Helper method for rendering line starting in multiple nodes and ending in one node.
Parameters :
Returns :
string
Rendered line. |
Protected _renderShape | ||||||||||||
_renderShape(text: string, shape: Shape)
|
||||||||||||
Inherited from
GraphBlock
|
||||||||||||
Defined in
GraphBlock:335
|
||||||||||||
Helper method for rendering defined shape with text.
Parameters :
Returns :
string
Rendered shape with text. |
Protected renderInSubgraph | ||||||||||||||||||||||||||||||
renderInSubgraph(_indent: number, id: string, text: string, bodyRenderer: (indent: number) => void, direction: "TB" | "TD" | "BT" | "LR" | "RL")
|
||||||||||||||||||||||||||||||
Inherited from
GraphBlock
|
||||||||||||||||||||||||||||||
Defined in
GraphBlock:86
|
||||||||||||||||||||||||||||||
Renders current node wrapped in a subgraph. Direction options:
Parameters :
Returns :
string
Graph wrapped in a subgraph. |
Public renderLazyDependencies | ||||||||
renderLazyDependencies(_indent: number)
|
||||||||
Inherited from
GraphBlock
|
||||||||
Defined in
GraphBlock:63
|
||||||||
Renders lazy dependencies of current node.
Parameters :
Returns :
string
|
Public toString |
toString()
|
Inherited from
GraphBlock
|
Defined in
GraphBlock:589
|
Returns :
string
|
blockKind |
getblockKind()
|
import { BlockKind } from '../block.kind';
import { BaseCycleDeclarationGraphBlock } from './base-cycle-declaration-graph.block';
import { GraphBlock } from './graph-block';
export class ForDeclarationGraphBlock extends BaseCycleDeclarationGraphBlock {
constructor(
id: string,
body: GraphBlock[],
private readonly initBlock: GraphBlock,
private readonly testBlock: GraphBlock,
private readonly updateBlock: GraphBlock
) {
super(id, body);
}
public override get blockKind(): BlockKind {
return BlockKind.FOR_DECLARATION;
}
protected renderCondition(): string {
return `${this.initBlock.toString()}; ${this.testBlock.toString()}; ${this.updateBlock.toString()}`;
}
}