Mercurial > dive4elements > river
changeset 114:394b9580ceae
Added mockup classes for working with rivers.
flys-artifacts/trunk@1303 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 08 Feb 2011 09:02:18 +0000 |
parents | f077df8ad54c |
children | b51e92fef704 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/River.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/RiverFactory.java |
diffstat | 3 files changed, 74 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Mon Feb 07 17:42:14 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue Feb 08 09:02:18 2011 +0000 @@ -1,3 +1,12 @@ +2011-02-08 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/model/RiverFactory.java, + src/main/java/de/intevation/flys/artifacts/model/River.java: New. A model + class that represents a river and its factory to create concrete river + instances. + NOTE: Currently, this is just a mockup. The factory just returns two + static rivers "Mosel" and "Saar" without a connection to a backend. + 2011-02-07 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/artifacts/states/StateFactory.java: The
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/River.java Tue Feb 08 09:02:18 2011 +0000 @@ -0,0 +1,34 @@ +package de.intevation.flys.artifacts.model; + +import java.io.Serializable; + + +/** + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class River implements Serializable { + + /** The river's name. */ + protected String name; + + + /** + * The default constructor that create a river with a name. + * + * @param name The name of the river. + */ + public River(String name) { + this.name = name; + } + + + /** + * Returns the name of the river. + * + * @return the name of the river. + */ + public String getName() { + return name; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/RiverFactory.java Tue Feb 08 09:02:18 2011 +0000 @@ -0,0 +1,31 @@ +package de.intevation.flys.artifacts.model; + +import java.util.ArrayList; +import java.util.List; + + +/** + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class RiverFactory { + + /** We don't need to instantiate concrete objects of this class. */ + private RiverFactory() { + } + + + /** + * Returns all rivers that were found in the backend. + * + * @return all rivers. + */ + public static List<River> getRivers() { + List<River> rivers = new ArrayList<River>(); + + rivers.add(new River("Mosel")); + rivers.add(new River("Saar")); + + return rivers; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :