java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java
branchv_0
changeset 105 39d8b427e20f
parent 104 245f1b88a3e6
child 106 e9c3583580c8
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java	Tue Dec 31 17:35:33 2013 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java	Tue Dec 31 18:11:50 2013 +0100
     1.3 @@ -20,6 +20,7 @@
     1.4  import java.util.ArrayList;
     1.5  import javax.xml.bind.annotation.XmlTransient;
     1.6  import static info.globalcode.sql.dk.Functions.findByName;
     1.7 +import java.util.Collections;
     1.8  
     1.9  /**
    1.10   * <p>List of configurables.</p>
    1.11 @@ -38,10 +39,17 @@
    1.12   *
    1.13   * @author Ing. František Kučera (frantovo.cz)
    1.14   */
    1.15 -public class Properties extends ArrayList<Property> {
    1.16 +public class Properties extends ArrayList<Property> implements Cloneable {
    1.17  
    1.18  	private Properties defaults;
    1.19  
    1.20 +	public Properties() {
    1.21 +	}
    1.22 +
    1.23 +	public Properties(int initialCapacity) {
    1.24 +		super(initialCapacity);
    1.25 +	}
    1.26 +
    1.27  	@XmlTransient
    1.28  	public Properties getDefaults() {
    1.29  		return defaults;
    1.30 @@ -73,4 +81,11 @@
    1.31  		Property p = findProperty(name);
    1.32  		return p == null ? defaultValue : Integer.valueOf(p.getValue());
    1.33  	}
    1.34 +
    1.35 +	@Override
    1.36 +	public Properties clone() {
    1.37 +		Properties clone = new Properties(size());
    1.38 +		Collections.copy(clone, this);
    1.39 +		return clone;
    1.40 +	}
    1.41  }