Skip to content
Snippets Groups Projects
between-criterion.model.ts 626 B
Newer Older
  • Learn to ignore specific revisions
  • François Agneray's avatar
    François Agneray committed
    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() {
    
    François Agneray's avatar
    François Agneray committed
            return this.id + ':bw:' + this.min + '|' + this.max;
    
    François Agneray's avatar
    François Agneray committed
        }
    }