Package org.gdbms.engine.instruction

Examples of org.gdbms.engine.instruction.IncompatibleTypesException


        DoubleValue ret = new DoubleValue();
        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


          ".*");
      pattern = pattern.replaceAll("\\?", ".");

      return new BooleanValue(this.value.matches(pattern));
    } else {
      throw new IncompatibleTypesException();
    }
  }
View Full Code Here

public abstract class AbstractValue implements Value {
  /**
   * @see com.hardcode.gdbms.engine.instruction.Operations#and(com.hardcode.gdbms.engine.values.value);
   */
  public Value and(Value value) throws IncompatibleTypesException {
    throw new IncompatibleTypesException("Cannot operate with " + value +
      " and " + this);
  }
View Full Code Here

  /**
   * @see com.hardcode.gdbms.engine.instruction.Operations#or(com.hardcode.gdbms.engine.values.value);
   */
  public Value or(Value value) throws IncompatibleTypesException {
    throw new IncompatibleTypesException("Cannot operate with " + value +
      " and " + this);
  }
View Full Code Here

  /**
   * @see com.hardcode.gdbms.engine.instruction.Operations#producto(com.hardcode.gdbms.engine.values.value);
   */
  public Value producto(Value value) throws IncompatibleTypesException {
    throw new IncompatibleTypesException("Cannot operate with " + value +
      " and " + this);
  }
View Full Code Here

  /**
   * @see com.hardcode.gdbms.engine.instruction.Operations#suma(com.hardcode.gdbms.engine.values.value);
   */
  public Value suma(Value value) throws IncompatibleTypesException {
    throw new IncompatibleTypesException("Cannot operate with " + value +
      " and " + this);
  }
View Full Code Here

  /**
   * @see org.gdbms.engine.instruction.Operations#inversa(org.gdbms.engine.values.Value)
   */
  public Value inversa() throws IncompatibleTypesException {
    throw new IncompatibleTypesException(this +
      " does not have inverse value");
  }
View Full Code Here

  /**
   * @see org.gdbms.engine.instruction.Operations#equals(org.gdbms.engine.values.Value)
   */
  public Value equals(Value value) throws IncompatibleTypesException {
    throw new IncompatibleTypesException("Cannot operate with " + value +
      " and " + this);
  }
View Full Code Here

  /**
   * @see org.gdbms.engine.instruction.Operations#notEquals(org.gdbms.engine.values.Value)
   */
  public Value notEquals(Value value) throws IncompatibleTypesException {
    throw new IncompatibleTypesException("Cannot operate with " + value +
      " and " + this);
  }
View Full Code Here

  /**
   * @see org.gdbms.engine.instruction.Operations#greater(org.gdbms.engine.values.Value)
   */
  public Value greater(Value value) throws IncompatibleTypesException {
    throw new IncompatibleTypesException("Cannot operate with " + value +
      " and " + this);
  }
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.