package de.dhbwstuttgart.syntaxtree;
import java.util.*;


import de.dhbwstuttgart.parser.NullToken;
import de.dhbwstuttgart.typecheck.JavaClassName;


public class SourceFile extends SyntaxTreeNode{
  private String pkgName;

  public List<ClassOrInterface> KlassenVektor = new ArrayList<>();
    private List<JavaClassName> imports;

    /**
     * Die SourceFile repräsntiert eine zu einem Syntaxbaum eingelesene Java-Datei.
     * SourceFile stellt dabei den Wurzelknoten des Syntaxbaumes dar.
     */
  public SourceFile(String pkgName,List<ClassOrInterface> classDefinitions,List<JavaClassName> imports){
    super(new NullToken());
    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;
  }
}