Пример #1
0
 public IValue multiply(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.MULTIPLY, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doMultiply(other, dataType);
 }
Пример #2
0
 public IValue subtract(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.SUBTRACT, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doSubtract(other, dataType);
 }
Пример #3
0
 public IValue greaterThan(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.GREATER_THAN, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doGreaterThan(other, dataType);
 }
Пример #4
0
 public IValue notEqualTo(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.NOT_EQUAL_TO, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doNotEqualTo(other, dataType);
 }
Пример #5
0
 public IValue divide(IValue other) {
   DataType dataType = getDataType().evaluate(OperatorKind.DIVIDE, other.getDataType());
   if (dataType instanceof InvalidDataType) {
     return InvalidValue.SINGLETON;
   }
   if (other instanceof AnyValue) {
     return new AnyValue(getContext(), dataType);
   }
   if (other instanceof UninitializedValue || other instanceof InvalidValue) {
     return InvalidValue.SINGLETON;
   }
   return doDivide(other, dataType);
 }