SourcePatchPoint eingeführt

This commit is contained in:
JanUlrich 2014-06-25 17:31:04 +02:00
parent edfa85df7f
commit 2ce0fd4dcd
3 changed files with 75 additions and 0 deletions

View File

@ -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<GenericTypeVar>{
public GenericDeclarationList(Vector<GenericTypeVar> vector) {
// TODO Auto-generated constructor stub
}
}

View File

@ -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<Pair> genericPairs = new Vector<Pair>();
/**
* 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);
}
}

View File

@ -0,0 +1,29 @@
package typinferenz.typedeployment;
import typinferenz.JavaCodeResult;
import typinferenz.ResultSet;
import typinferenz.TypeInsertable;
public abstract class SourcePatchPoint implements Comparable<SourcePatchPoint>{
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;
}
}