# HG changeset patch # User Ingo Weinzierl # Date 1297155738 0 # Node ID 394b9580ceae979203bcc29028e9e23876cb4df4 # Parent f077df8ad54c3a0f427927bdd61457a3dce9f77c Added mockup classes for working with rivers. flys-artifacts/trunk@1303 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r f077df8ad54c -r 394b9580ceae flys-artifacts/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/artifacts/states/StateFactory.java: The diff -r f077df8ad54c -r 394b9580ceae flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/River.java --- /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 Ingo Weinzierl + */ +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 : diff -r f077df8ad54c -r 394b9580ceae flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/RiverFactory.java --- /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 Ingo Weinzierl + */ +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 getRivers() { + List rivers = new ArrayList(); + + 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 :