Home Identifier Source Test Repository
public class | source

Model

Main checker model class

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get

Getter for external links items map

Private Members
private

Performed items

private

Map of external link items

private

Pending queue

private

Map of processed link items

Method Summary

Public Methods
public

addToActive(url: String): *

Add link url to list of active (checked at this moment)

public

addToExternal(url: String, baseUrl: String, href: String): Model

Add item to external links model

public

addToPending(url: String, advanced: Object): Model

Adds item to array of pending items

public

Returns true if items was not at provessed items

public

Returns true if active items array contains items

public

Returns true if external items map contains items

public

Returns length of active items array

public

Returns length of pending items array

public

isQueueFull(max: [type]): Boolean

Returns true of length of active items greater then given max number

public

Removes item corresponded to given url from active items array

public

Removes first item from pending items array and returns it

Public Constructors

public constructor source

Public Members

public get external: Map: * source

Getter for external links items map

Return:

Map

external items map

Private Members

private _active: Array source

Performed items

private _external: Map source

Map of external link items

private _pending: Array source

Pending queue

private _processed: Map source

Map of processed link items

Public Methods

public addToActive(url: String): * source

Add link url to list of active (checked at this moment)

Params:

NameTypeAttributeDescription
url String

of href found on page

Return:

*

public addToExternal(url: String, baseUrl: String, href: String): Model source

Add item to external links model

Params:

NameTypeAttributeDescription
url String

resolved from href

baseUrl String

page url where href was discovered

href String

found in document

Return:

Model

public addToPending(url: String, advanced: Object): Model source

Adds item to array of pending items

Params:

NameTypeAttributeDescription
url String

resolved url of link

advanced Object

info object

Return:

Model

public addToProcessed(url: String): boolean source

Returns true if items was not at provessed items Also item is put into processed map

Params:

NameTypeAttributeDescription
url String

resolved from link

Return:

boolean

public areActive(): Boolean source

Returns true if active items array contains items

Return:

Boolean

public areExternal(): Boolean source

Returns true if external items map contains items

Return:

Boolean

public getActiveLength(): Number source

Returns length of active items array

Return:

Number

public getPendingLength(): Number source

Returns length of pending items array

Return:

Number

public isQueueFull(max: [type]): Boolean source

Returns true of length of active items greater then given max number

Params:

NameTypeAttributeDescription
max [type]

[description]

Return:

Boolean

[description]

public removeFromActive(url: String): Model source

Removes item corresponded to given url from active items array

Params:

NameTypeAttributeDescription
url String

resolved from link

Return:

Model

public removeFromPending(): Object source

Removes first item from pending items array and returns it

Return:

Object