JavaPatternMatching/src/mycompiler/myparser/GenericVarDeclarationList.java

27 lines
652 B
Java
Raw Normal View History

2014-07-09 13:07:40 +00:00
package mycompiler.myparser;
import java.util.Vector;
import typinferenz.exceptions.DebugException;
import mycompiler.mytype.GenericTypeVar;
public class GenericVarDeclarationList {
private Vector<GenericTypeVar> elements = new Vector<>();
public void addElement(GenericTypeVar e){
elements.addElement(e);
}
public int getEndOffset() {
int ret;
if(elements.isEmpty())throw new DebugException("Es wurde eine GenericVarDeclarationList ohne Elemente geparst");
ret = elements.lastElement().getOffset() + elements.lastElement().getName().length();
return ret;
}
public Vector<GenericTypeVar> getElements(){
return elements;
}
}