public int readInteger() //exclusively for token
      {
         if(console)
         {
            if (buffer == null || !buffer.hasMoreTokens())
               try
               {
                  buffer = new StringTokenizer(myInFile.readLine());
                  return Integer.parseInt(buffer.nextToken());
               }
                  catch (IOException e)
                  {
                     e.printStackTrace();
                  }
                  catch (NumberFormatException f)
                  {
                     f.printStackTrace();
                  }
            else
               try 
               {
                  return Integer.parseInt(buffer.nextToken());
               }
                  catch (NumberFormatException f)
                  {
                     f.printStackTrace();
                  }
            return 0;
         }
         if(nonToken || isEOF)
            return 0;
         String answer = readString();
         try 
         {
            return Integer.parseInt(answer);
         }
            catch (NumberFormatException e)
            {
               e.printStackTrace();
            }
         return 0;
      }