Package org.gdbms.engine.values

Examples of org.gdbms.engine.values.Value


  public float getFloat(long row, String fieldName) throws DriverException {
    return getFloat(row, getFieldIndexByName(fieldName));
  }

  public float getFloat(long row, int fieldId) throws DriverException {
    Value v = getFieldValue(row, fieldId);
    if (v instanceof NullValue) {
      return 0;
    } else {
      return ((FloatValue) v).getValue();
    }
View Full Code Here


  public long getLong(long row, String fieldName) throws DriverException {
    return getLong(row, getFieldIndexByName(fieldName));
  }

  public long getLong(long row, int fieldId) throws DriverException {
    Value v = getFieldValue(row, fieldId);
    if (v instanceof NullValue) {
      return 0;
    } else {
      return ((LongValue) v).getValue();
    }
View Full Code Here

  public short getShort(long row, String fieldName) throws DriverException {
    return getShort(row, getFieldIndexByName(fieldName));
  }

  public short getShort(long row, int fieldId) throws DriverException {
    Value v = getFieldValue(row, fieldId);
    if (v instanceof NullValue) {
      return 0;
    } else {
      return ((ShortValue) v).getValue();
    }
View Full Code Here

  public String getString(long row, String fieldName) throws DriverException {
    return getString(row, getFieldIndexByName(fieldName));
  }

  public String getString(long row, int fieldId) throws DriverException {
    Value v = getFieldValue(row, fieldId);
    if (v instanceof NullValue) {
      return null;
    } else {
      return ((StringValue) v).getValue();
    }
View Full Code Here

  public Timestamp getTimestamp(long row, String fieldName) throws DriverException {
    return getTimestamp(row, getFieldIndexByName(fieldName));
  }

  public Timestamp getTimestamp(long row, int fieldId) throws DriverException {
    Value v = getFieldValue(row, fieldId);
    if (v instanceof NullValue) {
      return null;
    } else {
      return ((TimestampValue) v).getValue();
    }
View Full Code Here

  public Time getTime(long row, String fieldName) throws DriverException {
    return getTime(row, getFieldIndexByName(fieldName));
  }

  public Time getTime(long row, int fieldId) throws DriverException {
    Value v = getFieldValue(row, fieldId);
    if (v instanceof NullValue) {
      return null;
    } else {
      return ((TimeValue) v).getValue();
    }
View Full Code Here

  public void setTime(long row, int fieldId, Time value) throws DriverException {
    setFieldValue(row, fieldId, ValueFactory.createValue(value));
  }

  public boolean isNull(long row, int fieldId) throws DriverException {
    Value v = getFieldValue(row, fieldId);
    if (v instanceof NullValue) {
      return true;
    } else {
      return false;
    }
View Full Code Here

    /**
     * @see org.gdbms.engine.instruction.Expression#evaluate(long)
     */
    public Value evaluate(long row) throws EvaluationException {
        Value value = ((Expression)getChilds()[0]).evaluate(row);
        boolean b = value instanceof NullValue;
        if (getEntity().first_token.next.next.image.toLowerCase().equals("not")) b = !b;
        return ValueFactory.createValue(b);
    }
View Full Code Here

     
      int fieldIndex = tables[0].getFieldIndexByName(fieldName);
      if (fieldIndex == -1) throw new RuntimeException("we found the field name of the expression but could not find the field index?");
   
      for (int i = 0; i < tables[0].getRowCount(); i++) {
        Value v = tables[0].getFieldValue(i, fieldIndex);
        if (v instanceof NumericValue){
          res += ((NumericValue) v).doubleValue();
        }else{
          throw new ExecutionException("SUM only operates with numeric fields");
        }
View Full Code Here

TOP

Related Classes of org.gdbms.engine.values.Value

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.