From 356a2295739c8011ec7c31a983d2af159e21aa3e Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Wed, 3 Jun 2015 14:10:34 +0200 Subject: [PATCH] =?UTF-8?q?ConstraintsSet=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../typeinference/EinzelElement.java | 33 +++++++++++++++++++ .../typeinference/KomplexeMenge.java | 6 ++++ .../TypeInsertTests/LambdaTest28.jav | 11 +++++++ .../TypeInsertTests/LambdaTest28.java | 18 ++++++++++ 4 files changed, 68 insertions(+) create mode 100644 src/de/dhbwstuttgart/typeinference/EinzelElement.java create mode 100644 src/de/dhbwstuttgart/typeinference/KomplexeMenge.java create mode 100644 test/plugindevelopment/TypeInsertTests/LambdaTest28.jav create mode 100644 test/plugindevelopment/TypeInsertTests/LambdaTest28.java 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); + } + +}