Package org.gdbms.engine.instruction

Examples of org.gdbms.engine.instruction.IncompatibleTypesException


      Value ret = ValueFactory.createValue(this.value ||
          ((BooleanValue) value).getValue());

      return ret;
    } else {
      throw new IncompatibleTypesException();
    }
  }
View Full Code Here


   *
   * @throws IncompatibleTypesException DOCUMENT ME!
   */
  public Value producto(Value value) throws IncompatibleTypesException {
    if (!(value instanceof NumericValue)) {
      throw new IncompatibleTypesException();
    }

    return ValueFactory.producto(this, (NumericValue) value);
  }
View Full Code Here

   *
   * @throws IncompatibleTypesException DOCUMENT ME!
   */
  public Value suma(Value value) throws IncompatibleTypesException {
    if (!(value instanceof NumericValue)) {
      throw new IncompatibleTypesException();
    }

    return ValueFactory.suma(this, (NumericValue) value);
  }
View Full Code Here

    if (value instanceof NullValue) {
      return ValueFactory.createValue(false);
    }

    if (!(value instanceof NumericValue)) {
      throw new IncompatibleTypesException();
    }

    return ValueFactory.createValue(this.doubleValue() == ((NumericValue) value).doubleValue());
  }
View Full Code Here

    if (value instanceof NullValue) {
      return ValueFactory.createValue(false);
    }

    if (!(value instanceof NumericValue)) {
      throw new IncompatibleTypesException();
    }

    return ValueFactory.createValue(this.doubleValue() > ((NumericValue) value).doubleValue());
  }
View Full Code Here

    if (value instanceof NullValue) {
      return ValueFactory.createValue(false);
    }

    if (!(value instanceof NumericValue)) {
      throw new IncompatibleTypesException();
    }

    return ValueFactory.createValue(this.doubleValue() >= ((NumericValue) value).doubleValue());
  }
View Full Code Here

    if (value instanceof NullValue) {
      return ValueFactory.createValue(false);
    }

    if (!(value instanceof NumericValue)) {
      throw new IncompatibleTypesException();
    }

    return ValueFactory.createValue(this.doubleValue() < ((NumericValue) value).doubleValue());
  }
View Full Code Here

    if (value instanceof NullValue) {
      return ValueFactory.createValue(false);
    }

    if (!(value instanceof NumericValue)) {
      throw new IncompatibleTypesException();
    }

    return ValueFactory.createValue(this.doubleValue() <= ((NumericValue) value).doubleValue());
  }
View Full Code Here

    if (value instanceof NullValue) {
      return ValueFactory.createValue(false);
    }

    if (!(value instanceof NumericValue)) {
      throw new IncompatibleTypesException();
    }

    return ValueFactory.createValue(this.doubleValue() != ((NumericValue) value).doubleValue());
  }
View Full Code Here

        ret.setValue(Double.parseDouble(this.value) +
          ((IntValue) v).getValue());

        return ret;
      } catch (NumberFormatException e) {
        throw new IncompatibleTypesException(getValue() +
          " is not a number");
      }
    } else if (v instanceof LongValue) {
      try {
        DoubleValue ret = new DoubleValue();
        ret.setValue(Double.parseDouble(this.value) +
          ((LongValue) v).getValue());

        return ret;
      } catch (NumberFormatException e) {
        throw new IncompatibleTypesException(getValue() +
          " is not a number");
      }
    } else if (v instanceof FloatValue) {
      try {
        DoubleValue ret = new DoubleValue();
        ret.setValue(Double.parseDouble(this.value) +
          ((FloatValue) v).getValue());

        return ret;
      } catch (NumberFormatException e) {
        throw new IncompatibleTypesException(getValue() +
          " is not a number");
      }
    } else if (v instanceof DoubleValue) {
      try {
        DoubleValue ret = new DoubleValue();
        ret.setValue(Double.parseDouble(this.value) +
          ((DoubleValue) v).getValue());

        return ret;
      } catch (NumberFormatException e) {
        throw new IncompatibleTypesException(getValue() +
          " is not a number");
      }
    } else if (v instanceof StringValue) {
      try {
        DoubleValue ret = new DoubleValue();
        ret.setValue(Double.parseDouble(this.value) +
          Double.parseDouble(((StringValue) v).getValue()));

        return ret;
      } catch (NumberFormatException e) {
        throw new IncompatibleTypesException(getValue() +
          " is not a number");
      }
    } else {
      throw new IncompatibleTypesException();
    }
  }
View Full Code Here

TOP

Related Classes of org.gdbms.engine.instruction.IncompatibleTypesException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.