forked from JavaTX/JavaCompilerCore
Cloner durch Unify.deepClone in UndMenge.java ersetzt
This commit is contained in:
parent
3601d11b0b
commit
fbc1bc5b5b
@ -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()){ //Fü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);
|
||||
}
|
||||
|
@ -3648,7 +3648,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){
|
||||
|
||||
Menge<A> ret = m.stream().<A>map((Function<A,A>)(x -> x.deepClone())).<Menge<A>>collect(Menge::new, Menge::add, Menge::addAll);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user