raimund@1439: package de.intevation.flys.client.shared.model; raimund@1439: raimund@1439: import java.util.List; raimund@1503: import java.util.ArrayList; raimund@1439: raimund@1439: /** raimund@1439: * @author Raimund Renkert raimund@1439: */ raimund@1503: public class PropertyGroup implements Property, Cloneable { raimund@1439: raimund@1439: /** The group name */ raimund@1439: protected String name; raimund@1439: raimund@1439: protected List properties; raimund@1439: raimund@1439: public PropertyGroup() { raimund@1439: raimund@1439: } raimund@1439: raimund@1439: public PropertyGroup(String name) { raimund@1439: this.name = name; raimund@1439: } raimund@1439: raimund@1439: public PropertyGroup(String name, List properties) { raimund@1439: this.name = name; raimund@1439: this.properties = properties; raimund@1439: } raimund@1439: raimund@1439: public String getName() { raimund@1439: return this.name; raimund@1439: } raimund@1439: raimund@1439: public void setName(String name) { raimund@1439: this.name = name; raimund@1439: } raimund@1439: raimund@1439: public List getProperties() { raimund@1439: return this.properties; raimund@1439: } raimund@1439: raimund@1439: public void setProperties(List properties) { raimund@1439: this.properties = properties; raimund@1439: } raimund@1465: raimund@1465: public Property getPropertyByName(String name) { raimund@1465: for (int i = 0; i < properties.size(); i++) { raimund@1465: if (properties.get(i).getName().equals(name)) { raimund@1465: return properties.get(i); raimund@1465: } raimund@1465: } raimund@1465: return null; raimund@1465: } raimund@1503: raimund@1503: raimund@1503: public Object clone() { raimund@1503: PropertyGroup clone = new PropertyGroup(this.getName()); raimund@1503: List cloneList = new ArrayList(); raimund@1503: for(Property p: properties) { raimund@1503: cloneList.add((Property)p.clone()); raimund@1503: } raimund@1503: clone.setProperties(cloneList); raimund@1503: return clone; raimund@1503: } raimund@1439: }