JavaPatternMatching/src/de/dhbwstuttgart/syntaxtree/SourceFile.java

49 lines
1.3 KiB
Java
Raw Normal View History

2014-09-04 14:35:44 +00:00
package de.dhbwstuttgart.syntaxtree;
import java.util.*;
2015-08-27 11:36:14 +00:00
2016-12-15 14:45:23 +00:00
import de.dhbwstuttgart.typecheck.JavaClassName;
2013-10-18 11:33:46 +00:00
2017-01-11 15:42:02 +00:00
public class SourceFile extends SyntaxTreeNode{
private String pkgName;
2017-01-11 15:42:02 +00:00
public List<ClassOrInterface> KlassenVektor = new ArrayList<>();
2016-12-07 13:32:48 +00:00
private List<JavaClassName> imports;
2013-10-18 11:33:46 +00:00
/**
* Die SourceFile repräsntiert eine zu einem Syntaxbaum eingelesene Java-Datei.
* SourceFile stellt dabei den Wurzelknoten des Syntaxbaumes dar.
2013-10-18 11:33:46 +00:00
*/
2017-01-11 15:42:02 +00:00
public SourceFile(String pkgName,List<ClassOrInterface> classDefinitions,List<JavaClassName> imports){
this.KlassenVektor = classDefinitions;
if(pkgName != null){
this.pkgName = pkgName;
}
if(imports != null){
this.imports = imports;
}
}
public SourceFile(List<ClassOrInterface> classDefinitions){
this(null, classDefinitions, null);
}
public SourceFile(String pkgName, List<ClassOrInterface> classDefinitions){
this(pkgName, classDefinitions, null);
}
public SourceFile(List<ClassOrInterface> classDefinitions, List<JavaClassName> imports){
this(null, classDefinitions, imports);
}
public String getPkgName(){
return this.pkgName;
}
// Get imports (to test implementation)
public List<JavaClassName> getImports(){
return this.imports;
}
2013-10-18 11:33:46 +00:00
}