public void readTriangleFile(String inputFile)
   {
      
      // first read in the file and build the tree.
      java.io.File triFile = new java.io.File(inputFile);
      if ( triFile.exists() )
      {
	 int levels = 0;
	 StringBuilder bld = new StringBuilder("");
	 java.io.BufferedReader in = null;
	 try
	 {
	    java.io.FileReader fReader = new java.io.FileReader(triFile);
	    in = new java.io.BufferedReader(fReader);
	    
	    String curLine = "";
	    

	    while ( (curLine = in.readLine()) != null )
	    {	      
	       if ( bld.length() != 0 )
	       {
		  bld.append(",");
	       }
	       bld.append(curLine);
	       levels++;
	    }
	 }
	 catch ( java.io.IOException ioe )
	 {
	    System.out.println("IO Exception encountered: " + ioe);
	 }
	 finally
	 {
	    try
	    {
	       in.close();
	    }
	    catch ( java.io.IOException ioe )
	    {
		   System.out.println("IOException during close");
	    }
	    
	 }
	 triGrid = new java.util.ArrayList<java.util.ArrayList<Integer>>(levels);
	 // each row is comma separated
	 String[] inputLevels = bld.toString().split(",");
	 for ( int j = 0; j < inputLevels.length; j++ )
	 {
	    // the data in each row is space separated.
	    String[] rowData = inputLevels[j].split(" ");
	    java.util.ArrayList<Integer> rowArr = new java.util.ArrayList<Integer>(rowData.length);
	    for ( int i = 0; i < rowData.length; i++ )
	    {
	       rowArr.add(i,Integer.valueOf(rowData[i]));
	    }
	    triGrid.add(j,rowArr);
	 }

	 for ( int i = 0; i < triGrid.size(); i++ )
	 {
	    java.util.ArrayList<Integer> row = triGrid.get(i);
	    for ( int j = 0; j < row.size(); j++ )
	    {
	       System.out.print(row.get(j) + " ");
	    }
	    System.out.print("\n");
	 }
      
      }
      
   }