Mercurial > dive4elements > gnv-client
view gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultFIS.java @ 1101:e38f93d64253
A depth in an odv export has a negative value now (issue230).
gnv-artifacts/trunk@1227 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 28 Jun 2010 09:33:11 +0000 |
parents | 05bf8534a35a |
children | f953c9a559d8 |
line wrap: on
line source
package de.intevation.gnv.artifacts.services.requestobjects; import java.util.Collection; import java.util.Iterator; /** * The default implementation of <code>Fis</code>. * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ public class DefaultFIS implements FIS { /** * The ID of the FIS */ private String id = null; /** * The Parameter which belongs to the FIS. */ private Collection<Parameter> parameter = null; /** * Constructor * * @param id The id for this fis. */ public DefaultFIS(String id){ super(); this.id = id; } /** * Constructor * @param id The id for this fis. * @param parameter A collection of parameters. */ public DefaultFIS(String id, Collection<Parameter> parameter) { this(id); this.parameter = parameter; } public String getID() { return this.id; } public Collection<Parameter> getParameter() { return this.parameter; } /** * Two objects are equal if they have the same id. * * @param arg0 Object which is checked for equality. * @return True, if both objects are equal, otherwise false. */ @Override public boolean equals(Object arg0) { boolean returnValue = false; if (arg0 instanceof FIS){ returnValue = this.id.equals(((FIS)arg0).getID()); } return returnValue; } /** * Creates a hash code using the id and the given parameters. * * @return A hash code. */ @Override public int hashCode() { int hash = 7; hash = 47 * hash + (this.id != null ? this.id.hashCode() : 0); hash = 47 * hash + (this.parameter != null ? this.parameter.hashCode() : 0); return hash; } /** * @param parameter Collection of parameters. */ public void addParameter(Collection<Parameter> parameter) { if (this.parameter != null){ Iterator<Parameter> it = parameter.iterator(); while (it.hasNext()){ Parameter tmpParameter = it.next(); if (!this.parameter.contains(tmpParameter)){ this.parameter.add(tmpParameter); } } }else{ this.parameter = parameter; } } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :