view flys-client/src/main/java/de/intevation/flys/client/shared/model/FixingsOverviewInfo.java @ 2505:87ac5c532523

First part of the UI for fixing analysis parameter. flys-client/trunk@4350 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 07 May 2012 13:22:43 +0000
parents
children 256b458cc7ea
line wrap: on
line source
package de.intevation.flys.client.shared.model;

import java.io.Serializable;

import java.util.List;
import java.util.ArrayList;

public class FixingsOverviewInfo implements Serializable {

    protected List<FixEvent> events;
    protected String river;
    protected double from;
    protected double to;
    protected int rid;
    protected String html;

    protected FixingsOverviewInfo() {}

    public FixingsOverviewInfo(
        int rid,
        String river,
        double from,
        double to,
        List<FixEvent> events,
        String html
    ) {
        this.rid = rid;
        this.river = river;
        this.from = from;
        this.to = to;
        this.events = new ArrayList<FixEvent>(events);
        this.html = html;
    }

    public int getRId() {
        return this.rid;
    }

    public String getRiver() {
        return this.river;
    }

    public double getFrom() {
        return this.from;
    }

    public double getTo() {
        return this.to;
    }

    public List<FixEvent> getEvents() {
        return this.events;
    }

    public FixEvent getEventByCId(String cid) {
        for (int i = 0; i < events.size(); i++) {
            if (events.get(i).getCId().equals(cid)) {
                return events.get(i);
            }
        }
        return null;
    }

    public String getHTML() {
        return this.html;
    }


    public static class FixEvent implements Serializable {
        protected String cid;
        protected String date;
        protected String name;
        protected List<Sector> sectors;

        protected FixEvent () {}

        public FixEvent(
            String cid,
            String date,
            String name,
            List<Sector> sectors
        ) {
            this.cid = cid;
            this.date = date;
            this.name = name;
            this.sectors = new ArrayList<Sector>(sectors);
        }

        public String getCId() {
            return this.cid;
        }

        public String getDate() {
            return this.date;
        }

        public String getName() {
            return this.name;
        }

        public List<Sector> getSectors() {
            return this.sectors;
        }
    }

    public static class Sector implements Serializable {
        protected int cls;
        protected double from;
        protected double to;

        protected Sector () {}

        public Sector(
            int cls,
            double from,
            double to
        ) {
            this.cls = cls;
            this.from = from;
            this.to = to;
        }

        public int getCls() {
            return this.cls;
        }

        public double getFrom() {
            return this.from;
        }

        public double getTo() {
            return this.to;
        }
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org