UNPKG

ifc-expressions

Version:

Parsing and evaluation of IFC expressions

34 lines (33 loc) 891 B
import { Decimal } from "decimal.js"; import { Type } from "../type/Types.js"; export class NumericValue { constructor(value) { if (Decimal.isDecimal(value)) { this.numericValue = value; } this.numericValue = new Decimal(value); } static of(value) { return new NumericValue(value); } getValue() { return this.numericValue; } getType() { return Type.NUMERIC; } static isNumericValueType(arg) { return Decimal.isDecimal(arg.numericValue); } equals(other) { return (NumericValue.isNumericValueType(other) && this.numericValue.eq(other.numericValue)); } toString() { return this.numericValue.toString(); } compareTo(other) { return this.numericValue.comparedTo(other.numericValue); } } //# sourceMappingURL=NumericValue.js.map