Skip to content
Snippets Groups Projects
between-criterion.model.ts 626 B
import { Criterion } from './criterion.model';

export class BetweenCriterion extends Criterion {
    min: string;
    max: string;

    constructor(id: number, min: string, max: string) {
        super(id);
        this.min = min;
        this.max = max;
    }

    printCriterion(): string {
        if (this.min === '') {
            return '<= ' + this.max;
        } else if (this.max === '') {
            return '>= ' + this.min;
        } else {
            return '∈ [' + this.min + ';' + this.max + ']';
        }
    }

    getCriterionStr() {
        return this.id + '-bw-' + this.min + ':' + this.max;
    }
}