public class Baum
{
      public String wort;
      public ArrayList<Baum> ast;
      public Baum oberast=null;      
      public Baum(String wort)
      {
            this.wort = wort;
            this.ast = new ArrayList<Baum>();
      }
      
      public Baum addAst(String text)
      {     
            Baum b = new Baum(text);
            b.oberast=this;
            ast.add(b);
            return b;
      }
      
      public void addAeste(String[] texte)
      {
            for(int i=0;i<texte.length;i++)
                ast.add(new Baum(texte[i]));
      }
      
      public String[] getAeste()
      {
           String[] texte = new String[ast.size()];
           for(int i=0;i<texte.length;i++)
                texte[i]=ast.get(i).wort;
           return texte;     
      }
      
      public Baum getAst(int nr)
      {
            return ast.get(nr);
      }
      
      public int getAstAnzahl()
      {
            return ast.size();
      }
      
      public Baum getOberast()
      {
          return oberast;
      }
}
