Home Reference Source Test
public class | source

Match

Constructor Summary

Public Constructor
public

constructor(nodeArrays: Node[][])

Creates a new Match.

Method Summary

Public Methods
public

populateLines(fileContents: object)

Populates each match instance with a lines property containing the relevant source code lines.

Private Methods
private

_generateInstances(nodeArrays: Node[][]): object

Returns an array of objects containing the filename, start, end, and lines associated with all instances of a match.

private

_getHash(nodeArrays: Node[][]): String

Generates a hash for a match.

Public Constructors

public constructor(nodeArrays: Node[][]) source

Creates a new Match.

Params:

NameTypeAttributeDescription
nodeArrays Node[][]

Multi-dimensional array of nodes

Public Methods

public populateLines(fileContents: object) source

Populates each match instance with a lines property containing the relevant source code lines.

Params:

NameTypeAttributeDescription
fileContents object

The file paths and their contents

Private Methods

private _generateInstances(nodeArrays: Node[][]): object source

Returns an array of objects containing the filename, start, end, and lines associated with all instances of a match. Due to sibling traversal, the end line must be searched for among the nodes, and isn't always defined by the last node in the array.

Params:

NameTypeAttributeDescription
nodeArrays Node[][]

Multi-dimensional array of nodes

Return:

object

private _getHash(nodeArrays: Node[][]): String source

Generates a hash for a match.

Params:

NameTypeAttributeDescription
nodeArrays Node[][]

Multi-dimensional array of nodes

Return:

String