From 2ce0fd4dcdbf00ca51b37b96786ef8901d5fcc3d Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Wed, 25 Jun 2014 17:31:04 +0200 Subject: [PATCH] =?UTF-8?q?SourcePatchPoint=20eingef=C3=BChrt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../myclass/GenericDeclarationList.java | 21 ++++++++++++++ .../typedeployment/GenericVarPatch.java | 25 ++++++++++++++++ .../typedeployment/SourcePatchPoint.java | 29 +++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 src/mycompiler/myclass/GenericDeclarationList.java create mode 100644 src/typinferenz/typedeployment/GenericVarPatch.java create mode 100644 src/typinferenz/typedeployment/SourcePatchPoint.java diff --git a/src/mycompiler/myclass/GenericDeclarationList.java b/src/mycompiler/myclass/GenericDeclarationList.java new file mode 100644 index 00000000..433b5b4a --- /dev/null +++ b/src/mycompiler/myclass/GenericDeclarationList.java @@ -0,0 +1,21 @@ +package mycompiler.myclass; + +import java.util.Vector; + +import mycompiler.mytype.GenericTypeVar; + + +/** + * Stellt eine Deklarations-Liste von Generischen Variablen dar. + * Kann vor Methoden und Klassen auftauchen. (<....>) + * @author janulrich + * + */ +public class GenericDeclarationList extends Vector{ + + public GenericDeclarationList(Vector vector) { + // TODO Auto-generated constructor stub + } + + +} diff --git a/src/typinferenz/typedeployment/GenericVarPatch.java b/src/typinferenz/typedeployment/GenericVarPatch.java new file mode 100644 index 00000000..6be85549 --- /dev/null +++ b/src/typinferenz/typedeployment/GenericVarPatch.java @@ -0,0 +1,25 @@ +package typinferenz.typedeployment; + +import java.util.Vector; + +import mycompiler.mytype.Pair; + +/** + * Eine Hilfsklasse zur Einsetzung einer Generischen Variable. + * @author janulrich + * + */ +public class GenericVarPatch { + + private Vector genericPairs = new Vector(); + + /** + * Fügt eine generische Variable in Form eines Pairs an. + * @param p + */ + public void add(Pair p){ + if(!this.genericPairs.contains(p))this.genericPairs.add(p); + } + + +} diff --git a/src/typinferenz/typedeployment/SourcePatchPoint.java b/src/typinferenz/typedeployment/SourcePatchPoint.java new file mode 100644 index 00000000..c4d4875a --- /dev/null +++ b/src/typinferenz/typedeployment/SourcePatchPoint.java @@ -0,0 +1,29 @@ +package typinferenz.typedeployment; + +import typinferenz.JavaCodeResult; +import typinferenz.ResultSet; +import typinferenz.TypeInsertable; + +public abstract class SourcePatchPoint implements Comparable{ + protected TypeInsertable point; + protected ResultSet resultSet; + public abstract int getOffset(); + public ResultSet getResultSet() { + return resultSet; + } + public TypeInsertable getTIP() { + return point; + } + + @Override + public int compareTo(SourcePatchPoint arg0) { + return new Integer(this.getOffset()).compareTo(new Integer(arg0.getOffset())); + } + public JavaCodeResult patch(String fileContent, int additionalOffset) { + return new JavaCodeResult(fileContent); + } + public int getInsertLength() { + return 0; + } + +}