ConstraintsSet überarbeitet

This commit is contained in:
JanUlrich 2015-06-03 14:10:34 +02:00
parent 6bb01f012f
commit 356a229573
4 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,33 @@
package de.dhbwstuttgart.typeinference;
import com.rits.cloning.Cloner;
public class EinzelElement<A> implements KomplexeMenge<A>{
private A item;
public EinzelElement(A element){
item = element;
}
public Menge<KomplexeMenge<A>> getSet(){
Menge<KomplexeMenge<A>> ret = new Menge<>();
ret.add(this);
return ret;
}
@Override
public Menge<Menge<A>> cartesianProduct() {
Cloner cloner = new Cloner();
Menge<Menge<A>> ret = new Menge<>();
Menge<A> i = new Menge<A>();
i.add(cloner.deepClone(item));
ret.add(i);
return ret;
}
@Override
public String toString(){
return item.toString();
}
}

View File

@ -0,0 +1,6 @@
package de.dhbwstuttgart.typeinference;
public interface KomplexeMenge<A>{
Menge<? extends KomplexeMenge<A>> getSet();
Menge<Menge<A>> cartesianProduct();
}

View File

@ -0,0 +1,11 @@
class Klasse{
main(param){
return param.methode();
}
}
class Klasse1{
<A> A methode(){
return null;
}
}

View File

@ -0,0 +1,18 @@
package plugindevelopment.TypeInsertTests;
import de.dhbwstuttgart.typeinference.Menge;
import org.junit.Test;
public class LambdaTest28 {
private static final String TEST_FILE = "LambdaTest28.jav";
@Test
public void run(){
Menge<String> mustContain = new Menge<String>();
//mustContain.add("A a");
MultipleTypesInsertTester.test(this.TEST_FILE, mustContain);
}
}