Class Index | File Index

Classes


Class Constraint


Extends TableNode.

Defined in: Constraint.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Constraint(description)
A Constraint represents a property that must be satisfied once and only once by any set of choices.
Method Summary
Method Attributes Method Name and Description
<static>  
Constraint.forEachSatisfyingChoice(func)
Iterates over each choice that could satisfy this constraint.
<static>  
Constraint.satisfy(hiddenNodes)
Indicates that this constraint has been satisfied, hiding it and all choices that would satisfy it (since it must be satisfied by exactly one choice according to the rules of exact cover).
<static>  
Constraint.toString()
Methods borrowed from class TableNode:
addToHeadersChains, forEachColumn, forEachRow, hideFromColumn, hideFromRow
Class Detail
Constraint(description)
A Constraint represents a property that must be satisfied once and only once by any set of choices.

It is a TableNode, with a non enumerable row and column chain because it is intended to be used as a column header.

Parameters:
description
{Object} can be anything, but is associated with this constraint.
Method Detail
<static> Constraint.forEachSatisfyingChoice(func)
Iterates over each choice that could satisfy this constraint.
Parameters:
func
{function} a function that will be called back with the choice that would satisfy this constraint and the TableNode that links this constraint to that choice. Returning false will terminate the loop early. May not be null.

<static> Constraint.satisfy(hiddenNodes)
Indicates that this constraint has been satisfied, hiding it and all choices that would satisfy it (since it must be satisfied by exactly one choice according to the rules of exact cover).
Parameters:
hiddenNodes
{Array} an array that all nodes hidden as part of this operation will be added to. May not be null.

<static> Constraint.toString()

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Mar 26 2017 13:50:28 GMT+0000 (UTC)