view gnv-artifacts/src/main/java/de/intevation/gnv/math/AttributedPoint2ds.java @ 809:d05b17a4f3d0

Added javadoc in describedata package. gnv-artifacts/trunk@891 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 09 Apr 2010 07:27:38 +0000
parents 2e951160c43d
children f953c9a559d8
line wrap: on
line source
package de.intevation.gnv.math;

import com.vividsolutions.jts.geom.MultiLineString;
import com.vividsolutions.jts.geom.MultiPolygon;

import de.intevation.gnv.utils.Pair;

import java.io.Serializable;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Stores the results of an area interpolation.
 * Used to generate the final products.
 *
 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
 */
public class AttributedPoint2ds
implements   Serializable
{
    /**
     * The list of input points.
     */
    protected List<? extends Point2d>             points;

    /**
     * The map of input attributes that are need to generate
     * the products.
     */
    protected Map                                 attributes;

    /**
     * The interpolation result.
     */
    protected AreaInterpolation                   interpolation;

    /**
     * The JTS multi line strings to be written by GeoTools later.
     */
    protected List<Pair<Object, MultiLineString>> lineStrings;

    /**
     * The JTS multi polygons to be written by GeoTools later.
     */
    protected Map<Integer, MultiPolygon>          polygons;

    /**
     * Default constructor.
     */
    public AttributedPoint2ds() {
    }

    /**
     * Constructor to create a AttributedPoint2ds with a list
     * of input points.
     *
     * @param points The input points.
     */
    public AttributedPoint2ds(List<? extends Point2d> points) {
        this.points = points;
    }

    /**
     * Returns an attribute from the map of external attributes.
     * @param key The key of the attribute.
     * @return The attribute or null if the attribute was not found.
     */
    public Object getAttribute(Object key) {
        return attributes != null
            ? attributes.get(key)
            : null;
    }

    /**
     * Stores an attribute under a given key in
     * the map of external attributes.
     * @param key The key of the attribute.
     * @param value The attribute value.
     */
    public void setAttribute(Object key, Object value) {
        if (attributes == null) {
            attributes = new HashMap();
        }
        attributes.put(key, value);
    }

    /**
     * Returns the input points.
     * @return The input points.
     */
    public List<? extends Point2d> getPoints() {
        return points;
    }

    /**
     * Sets the input points.
     * @param points The input points.
     */
    public void setPoints(List<? extends Point2d> points) {
        this.points = points;
    }

    /**
     * Sets the area interpolation result.
     * @param interpolation The new interpolation result.
     */
    public void setInterpolation(AreaInterpolation interpolation) {
        this.interpolation = interpolation;
    }

    /**
     * Returns the area interpolation result.
     * @return The interpolation result.
     */
    public AreaInterpolation getInterpolation() {
        return interpolation;
    }

    /**
     * Sets the produced JTS multi polygons.
     * @param polygons The multi polygons.
     */
    public void setPolygons(Map<Integer, MultiPolygon> polygons) {
        this.polygons = polygons;
    }

    /**
     * Returns the JTS multi polygons.
     * @return The polygons.
     */
    public Map<Integer, MultiPolygon> getPolygons() {
        return polygons;
    }

    /**
     * Set the produced JTS multi line strings.
     * @param lineStrings The line strings.
     */
    public void setLineStrings(
        List<Pair<Object, MultiLineString>> lineStrings
    ) {
        this.lineStrings = lineStrings;
    }

    /**
     * Returns the produced JTS multi line strings.
     * @return The line strings.
     */
    public List<Pair<Object, MultiLineString>> getLineStrings() {
        return lineStrings;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org