merge und Timer anfügen

This commit is contained in:
JanUlrich 2015-07-22 19:56:39 +02:00
commit ae372cdd3b
2 changed files with 6 additions and 5 deletions

View File

@ -1,18 +1,19 @@
package de.dhbwstuttgart.typeinference;
import de.dhbwstuttgart.typeinference.unify.Unify;
import java.util.Collection;
import java.util.Iterator;
import com.rits.cloning.Cloner;
//import com.rits.cloning.Cloner;
public abstract class UndMenge<A> implements KomplexeMenge<A>{
public abstract class UndMenge<A extends DeepCloneable> implements KomplexeMenge<A>{
public abstract Menge<? extends KomplexeMenge<A>> getSet();
@Override
public Menge<Menge<A>> cartesianProduct() {
Menge<Menge<A>> ret = null;
Cloner cloner = new Cloner();
//Cloner cloner = new Cloner();
for(KomplexeMenge<A> km : this.getSet()){
if(ret == null){
ret = km.cartesianProduct();
@ -20,7 +21,7 @@ public abstract class UndMenge<A> implements KomplexeMenge<A>{
Menge<Menge<A>> cartesianProduct = new Menge<>();
for(Menge<A> r : ret)for(Menge<A> m : km.cartesianProduct()){ //¼r jedes Element aus dem Karthesischen Produkt:
Menge<A> undElement = new Menge<A>();
undElement.addAll(cloner.deepClone(r));
undElement.addAll(Unify.deepClone(r));
undElement.addAll(m);
cartesianProduct.add(undElement);
}

View File

@ -3649,7 +3649,7 @@ tempKlasse.get_Superclass_Name() ); System.out.println( "P. S.:
return T instanceof FreshWildcardType;
}
private static <A extends DeepCloneable> Menge<A> deepClone(Menge<A> m){
public static <A extends DeepCloneable> Menge<A> deepClone(Menge<A> m){
Timewatch watch = Timewatch.getTimewatch();
Timestamp timer = watch.start("Unify - deepClone");
Menge<A> ret = m.stream().<A>map((Function<A,A>)(x -> x.deepClone())).<Menge<A>>collect(Menge::new, Menge::add, Menge::addAll);