view flys-client/src/main/java/de/intevation/flys/client/shared/model/PropertyGroup.java @ 3847:f3b821735e39

Calculate the info url via i18n Don't fetch the info url from the artifact service and use i18n to calculate the url by using the official gauge and river number. flys-client/trunk@5582 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Mon, 24 Sep 2012 08:39:22 +0000
parents 3304608baf35
children 62332fa199bf
line wrap: on
line source
package de.intevation.flys.client.shared.model;

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

/**
 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
 */
public class PropertyGroup implements Property, Cloneable {

    /** The group name */
    protected String name;

    protected List<Property> properties;

    public PropertyGroup() {

    }

    public PropertyGroup(String name) {
        this.name = name;
    }

    public PropertyGroup(String name, List<Property> properties) {
        this.name = name;
        this.properties = properties;
    }

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

    public void setName(String name) {
        this.name = name;
    }

    public List<Property> getProperties() {
        return this.properties;
    }

    public void setProperties(List<Property> properties) {
        this.properties = properties;
    }

    public Property getPropertyByName(String name) {
        for (int i = 0; i < properties.size(); i++) {
            if (properties.get(i).getName().equals(name)) {
                return properties.get(i);
            }
        }
        return null;
    }


    public Object clone() {
        PropertyGroup clone = new PropertyGroup(this.getName());
        List<Property> cloneList = new ArrayList<Property>();
        for(Property p: properties) {
            cloneList.add((Property)p.clone());
        }
        clone.setProperties(cloneList);
        return clone;
    }
}

http://dive4elements.wald.intevation.org