Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputData.java @ 796:a5526908f92f
Added javadoc in state package.
gnv-artifacts/trunk@878 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 01 Apr 2010 09:15:36 +0000 |
parents | e764cab8c885 |
children | feae2f9d6c6f |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputData.java Wed Mar 31 13:48:07 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputData.java Thu Apr 01 09:15:36 2010 +0000 @@ -6,6 +6,9 @@ import org.apache.log4j.Logger; /** + * The default implementation of <code>InputData</code>. This object stores + * multiple values separated by {@link #VALUE_SEPARATOR} for a specific key. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ @@ -18,27 +21,59 @@ private static final Logger logger = Logger.getLogger(DefaultInputData.class); + /** + * The character used to separate the different values. + */ public final static String VALUE_SEPARATOR = " , "; + /** + * The key/name of this object. + */ protected String name; + + /** + * Values separated by {@link #VALUE_SEPARATOR}. + */ protected String value; + + /** + * Descriptions for values used for user interface creation. Each value + * should have an own description in this map. + */ protected Map description; + + /** + * An extra object. Might be everything. + */ protected Object object; /** * Constructor + * @param name + * @param value */ public DefaultInputData(String name, String value) { this.name = name; this.value = value; } + /** + * + * @param name + * @param object + */ public DefaultInputData(String name, Object object) { this.name = name; this.object = object; } + /** + * + * @param name + * @param value + * @param object + */ public DefaultInputData( String name, String value, @@ -50,27 +85,40 @@ } /** - * @see de.intevation.gnv.state.InputData#getName() + * @return */ public String getName() { return this.name; } /** - * @see de.intevation.gnv.state.InputData#getValue() + * @return */ public String getValue() { return this.value; } + /** + * + * @param object + */ public void setObject(Object object) { this.object = object; } + /** + * + * @return + */ public Object getObject() { return object; } + /** + * + * @param key Key needs to be a single value of {@link #value}. + * @return the description. + */ public String getDescription(String key) { if (description == null) return null; @@ -78,6 +126,11 @@ return (String) description.get(key); } + /** + * Return all descriptions as array. + * + * @return descriptions as array. + */ public String[] getDescription() { String[] values = splitValue(); int length = values.length; @@ -90,6 +143,10 @@ return description; } + /** + * + * @param description + */ public void setDescription(String[] description) { if (this.description == null) this.description = new HashMap(); @@ -110,7 +167,7 @@ } /** - * @see java.lang.Object#toString() + * @return */ @Override public String toString() { @@ -118,14 +175,14 @@ } /** - * @see de.intevation.gnv.state.InputData#concartValue(java.lang.String) + * @param value */ public void concartValue(String value) { this.value = this.value + VALUE_SEPARATOR + value; } /** - * @see de.intevation.gnv.state.InputData#splitValue() + * @return */ public String[] splitValue() { if (this.value != null){ @@ -135,3 +192,4 @@ } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file