adding the convept of next/previous to values in the command line

This commit is contained in:
Joe Walker 2010-12-15 13:38:02 +00:00
commit e9fd963724
7 changed files with 310 additions and 144 deletions

View file

@ -363,6 +363,28 @@ Assignment.prototype = {
this.conversion.predictions.length > 0) {
this.setValue(this.conversion.predictions[0]);
}
},
/**
* Replace the current value with the lower value if such a concept
* exists.
*/
decrement: function() {
var replacement = this.param.type.decrement(this.value);
if (replacement != null) {
this.setValue(replacement);
}
},
/**
* Replace the current value with the higher value if such a concept
* exists.
*/
increment: function() {
var replacement = this.param.type.increment(this.value);
if (replacement != null) {
this.setValue(replacement);
}
}
};
exports.Assignment = Assignment;