java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java
branchv_0
changeset 105 39d8b427e20f
parent 104 245f1b88a3e6
child 106 e9c3583580c8
--- a/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java	Tue Dec 31 17:35:33 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/configuration/Properties.java	Tue Dec 31 18:11:50 2013 +0100
@@ -20,6 +20,7 @@
 import java.util.ArrayList;
 import javax.xml.bind.annotation.XmlTransient;
 import static info.globalcode.sql.dk.Functions.findByName;
+import java.util.Collections;
 
 /**
  * <p>List of configurables.</p>
@@ -38,10 +39,17 @@
  *
  * @author Ing. František Kučera (frantovo.cz)
  */
-public class Properties extends ArrayList<Property> {
+public class Properties extends ArrayList<Property> implements Cloneable {
 
 	private Properties defaults;
 
+	public Properties() {
+	}
+
+	public Properties(int initialCapacity) {
+		super(initialCapacity);
+	}
+
 	@XmlTransient
 	public Properties getDefaults() {
 		return defaults;
@@ -73,4 +81,11 @@
 		Property p = findProperty(name);
 		return p == null ? defaultValue : Integer.valueOf(p.getValue());
 	}
+
+	@Override
+	public Properties clone() {
+		Properties clone = new Properties(size());
+		Collections.copy(clone, this);
+		return clone;
+	}
 }