UNPKG

890 BPlain TextView Raw
1import {bind, provide, Provider} from 'angular2/src/core/di';
2import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
3
4import {MeasureValues} from './measure_values';
5
6/**
7 * A Validator calculates a valid sample out of the complete sample.
8 * A valid sample is a sample that represents the population that should be observed
9 * in the correct way.
10 */
11export abstract class Validator {
12 static bindTo(delegateToken): Provider[] {
13 return [bind(Validator).toFactory((delegate) => delegate, [delegateToken])];
14 }
15
16 /**
17 * Calculates a valid sample out of the complete sample
18 */
19 validate(completeSample: MeasureValues[]): MeasureValues[] { throw new BaseException('NYI'); }
20
21 /**
22 * Returns a Map that describes the properties of the validator
23 * (e.g. sample size, ...)
24 */
25 describe(): {[key: string]: any} { throw new BaseException('NYI'); }
26}