diff --git a/src/de/dhbwstuttgart/typeinference/EinzelElement.java b/src/de/dhbwstuttgart/typeinference/EinzelElement.java new file mode 100644 index 00000000..58f4970d --- /dev/null +++ b/src/de/dhbwstuttgart/typeinference/EinzelElement.java @@ -0,0 +1,33 @@ +package de.dhbwstuttgart.typeinference; + +import com.rits.cloning.Cloner; + +public class EinzelElement implements KomplexeMenge{ + private A item; + + public EinzelElement(A element){ + item = element; + } + + public Menge> getSet(){ + Menge> ret = new Menge<>(); + ret.add(this); + return ret; + } + + @Override + public Menge> cartesianProduct() { + Cloner cloner = new Cloner(); + Menge> ret = new Menge<>(); + Menge i = new Menge(); + i.add(cloner.deepClone(item)); + ret.add(i); + return ret; + } + + @Override + public String toString(){ + return item.toString(); + } + +} \ No newline at end of file diff --git a/src/de/dhbwstuttgart/typeinference/KomplexeMenge.java b/src/de/dhbwstuttgart/typeinference/KomplexeMenge.java new file mode 100644 index 00000000..25ca29e8 --- /dev/null +++ b/src/de/dhbwstuttgart/typeinference/KomplexeMenge.java @@ -0,0 +1,6 @@ +package de.dhbwstuttgart.typeinference; + +public interface KomplexeMenge{ + Menge> getSet(); + Menge> cartesianProduct(); +} \ No newline at end of file diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest28.jav b/test/plugindevelopment/TypeInsertTests/LambdaTest28.jav new file mode 100644 index 00000000..c91288ab --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest28.jav @@ -0,0 +1,11 @@ +class Klasse{ + main(param){ + return param.methode(); + } +} + +class Klasse1{ + A methode(){ + return null; + } +} diff --git a/test/plugindevelopment/TypeInsertTests/LambdaTest28.java b/test/plugindevelopment/TypeInsertTests/LambdaTest28.java new file mode 100644 index 00000000..ae9353a9 --- /dev/null +++ b/test/plugindevelopment/TypeInsertTests/LambdaTest28.java @@ -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 mustContain = new Menge(); + //mustContain.add("A a"); + MultipleTypesInsertTester.test(this.TEST_FILE, mustContain); + } + +}