view geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java @ 133:56655046194f

Fix Bug setting the Filtervalues into the Statement. Further Testcases implemented. geo-backend/trunk@14 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 04 Sep 2009 08:49:50 +0000
parents 5a583cff97ea
children d43ff60acda4
line wrap: on
line source
/**
 *
 */
package de.intevation.gnv.geobackend.base;

import java.util.Date;
import java.util.HashMap;

/**
 * Defaultimplementation of the Interface Result.
 * This Class stores the Attributevalues of one Result.
 * @author Tim Englich <tim.englich@intevation.de>
 *
 */
public class DefaultResult implements Result {

    /**
     * HashMap which stores the Columnvalues identified by the unique Columnname
     */
    private HashMap<String, Object> columnValues = new HashMap<String, Object>();
    
    
    /**
     * The ResultDescriptor which describes the ColumnValues
     */
    private ResultDescriptor resultDescriptor = null;
    
    /**
     * Constructor
     */
    public DefaultResult(ResultDescriptor resultDescriptor) {
        super();
        this.resultDescriptor = resultDescriptor;
    }

    /**
     * @see de.intevation.gnv.geobackend.base.Result#getDate(java.lang.String)
     */
    public Date getDate(String columnName) {
        return (Date)this.columnValues.get(columnName);
    }

    /**
     * @see de.intevation.gnv.geobackend.base.Result#getDouble(java.lang.String)
     */
    public Double getDouble(String columnName) {
        return (Double)this.columnValues.get(columnName);
    }

    /**
     * @see de.intevation.gnv.geobackend.base.Result#getFloat(java.lang.String)
     */
    public Float getFloat(String columnName) {
        return (Float)this.columnValues.get(columnName);
    }

    /**
     * @see de.intevation.gnv.geobackend.base.Result#getInteger(java.lang.String)
     */
    public Integer getInteger(String columnName) {
        return (Integer)this.columnValues.get(columnName);
    }

    /**
     * @see de.intevation.gnv.geobackend.base.Result#getResultDescriptor()
     */
    public ResultDescriptor getResultDescriptor() {
        return this.resultDescriptor;
    }

    /**
     * @see de.intevation.gnv.geobackend.base.Result#getString(java.lang.String)
     */
    public String getString(String columnName) {
        return this.columnValues.get(columnName).toString();
    }

    /**
     * @see de.intevation.gnv.geobackend.base.Result#addColumnValue(java.lang.String, java.lang.Object)
     */
    public void addColumnValue(String columnName, Object value) {
        this.columnValues.put(columnName, value);
    }

    /**
     * @see de.intevation.gnv.geobackend.base.Result#getObject(java.lang.String)
     */
    public Object getObject(String columnName) {
        return this.columnValues.get(columnName);
    }

}

http://dive4elements.wald.intevation.org