|
@@ -31,8 +31,7 @@ public class HolonObject extends CpsObject {
|
|
|
|
|
|
public HolonObject(CpsObject obj) {
|
|
|
super(obj);
|
|
|
- setElements(((HolonObject) obj).getElements());
|
|
|
-
|
|
|
+ setElements(((HolonObject) obj).getCopyofElements());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -94,4 +93,20 @@ public class HolonObject extends CpsObject {
|
|
|
}
|
|
|
return objString;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Copys the ArrayList
|
|
|
+ *
|
|
|
+ * @param the ArrayList to Copy
|
|
|
+ *
|
|
|
+ * @return the currentEnergy
|
|
|
+ */
|
|
|
+ public ArrayList<HolonElement> getCopyofElements() {
|
|
|
+ ArrayList<HolonElement> temp = new ArrayList<>();
|
|
|
+ for (HolonElement h : elements) {
|
|
|
+ HolonElement he = new HolonElement(h);
|
|
|
+ temp.add(he);
|
|
|
+ }
|
|
|
+ return temp;
|
|
|
+ }
|
|
|
}
|