Package org.gdbms.engine.values

Examples of org.gdbms.engine.values.Value


            }
        } else {
            return ValueFactory.createNullValue();
        }

        Value value = ValueFactory.createValue(campos[fieldId]);

        return value;
    }
View Full Code Here


                }
            });
        }

        public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
            Value v;
            try {
                v = ValueFactory.createValueByType(aValue.toString(), ds.getDataSourceMetadata().getFieldType(columnIndex));
                ds.setFieldValue(rowIndex, columnIndex, v);
            } catch (DriverException e1) {
                throw new RuntimeException(e1);
View Full Code Here

            row.remove(index);
        }
    }

    public void addField() {
        Value nullValue = ValueFactory.createNullValue();
        for (int i = 0; i < rows.size(); i++) {
            ArrayList<Value> row = rows.get(i);
            row.add(nullValue);
        }
    }
View Full Code Here

        }
    }

    public Value getFieldValue(long rowIndex, int fieldId)
            throws DriverException {
        Value ret = null;
        if (dbws == null) {
            ret = ds.getOriginalFieldValue(rowIndex, fieldId);
        } else {
            ret = dbws.getFieldValue(rowIndex, fieldId);
        }
View Full Code Here

    gp.moveTo(10.0, 10.0);
    gp.lineTo(10.0, 20.0);
    gp.lineTo(20.0, 20.0);
    gp.lineTo(20.0, 10.0);
    gp.closePath();
    Value v = GeometryFactory.createPolygon2D(gp);
    return v;
  }
View Full Code Here

     * @see org.gdbms.engine.data.driver.ReadAccess#getFieldValue(long,
     *      int)
     */
    public Value getFieldValue(long rowIndex, int fieldId)
            throws DriverException {
        Value value = null;

        try {
            fieldId += 1;
            resultSet.absolute((int) rowIndex + 1);

View Full Code Here

    public Rectangle2D getFullExtent() throws DriverException {
        if (recalculateExtent) {
            editionFullExtent = null;
            for (int i = 0; i < sds.getRowCount(); i++) {
                Value v = sds.getFieldValue(i, getSFI());
                if (!(v instanceof NullValue)) {
                    Rectangle2D r = ((IGeometry)v).getBounds2D();
                    if (editionFullExtent == null) {
                        editionFullExtent = r;
                    } else {
View Full Code Here

                getBounds().add(null);
            }
        }
        Rectangle2D ret = getBounds().get((int) rowIndex);
        if (ret == null) {
            Value v = sds.getFieldValue(rowIndex, getSFI());
            if (v instanceof NullValue) {
                ret = null;
            } else {
                ret = ((IGeometry) v).getBounds2D();
            }
View Full Code Here

   * @return DOCUMENT ME!
   *
   * @throws RuntimeException DOCUMENT ME!
   */
  private int compare(Object o1, Object o2) {
    Value v1 = (Value) o1;
    Value v2 = (Value) o2;

    try {
      if (((BooleanValue) v1.less(v2)).getValue()) {
        return -1;
      } else if (((BooleanValue) v2.less(v1)).getValue()) {
        return 1;
      } else {
        return 0;
      }
    } catch (IncompatibleTypesException e) {
View Full Code Here

public class SQLTest extends DataSourceTestCase {
    public void testIsClause() throws Exception {
        DataSource d = ds.executeSQL(
                "select * from persona where apellido is null;");
        d.start();
        Value v0 = ValueFactory.createValue(2);
        Value v1 = ValueFactory.createValue("fernan");
        Value v2 = ValueFactory.createNullValue();
        assertTrue(d.getRowCount() == 1);
        assertTrue(((BooleanValue) d.getFieldValue(0, 0).equals(v0)).getValue());
        assertTrue(((BooleanValue) d.getFieldValue(0, 1).equals(v1)).getValue());
        assertTrue(d.getFieldValue(0, 2) instanceof NullValue);
        d.stop();

        d = ds.executeSQL("select * from persona where apellido is not null;");
        d.start();
        v0 = ValueFactory.createValue(0);
        v1 = ValueFactory.createValue("fernando");
        v2 = ValueFactory.createValue("gonzalez");
        Value v3 = ValueFactory.createValue(1);
        Value v4 = ValueFactory.createValue("huracan");
        Value v5 = ValueFactory.createValue("gonsales");
        assertTrue(d.getRowCount() == 2);
        assertTrue(((BooleanValue) d.getFieldValue(0, 0).equals(v0)).getValue());
        assertTrue(((BooleanValue) d.getFieldValue(0, 1).equals(v1)).getValue());
        assertTrue(((BooleanValue) d.getFieldValue(0, 2).equals(v2)).getValue());
        assertTrue(((BooleanValue) d.getFieldValue(1, 0).equals(v3)).getValue());
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.