title: Using scanner to find the end of a line?
body: <p>I am scanning text into a program using the scanner class, 
  and each line of the text file is a booking of the form </p>
  
  <pre><code>(id) (month) (date) (numdays) (type1) (number1) (type2) (number2) . . .
  </code></pre>
  
  <p>The first four elements of the booking data are always the 
  same number i.e. 4, but the (type) and (number) data could have 
  any number of arguments, hence I want to detect the end of a line
  is there any way to do this with the scanner class?</p>
  
  <p>I want to find the end of a line so my code doesn't read the 
  next line a continuation of a booking. </p>
  
  <p>} else if(input.equals("Booking")) {  </p>
  
  <pre><code>                int bookingId=inputStream.nextInt();
                  System.out.printf("%d ",bookingId);
                  String month = inputStream.next();
                  System.out.printf("%s ", month);
                  int date = inputStream.nextInt();
                  System.out.printf("%d ", date);
                  int numDays= inputStream.nextInt();
                  System.out.printf("%d ", numDays);
  
  
                  while(!(inputStream.findInLine("\n").equals("\n"))){
                     String nextType = inputStream.next();
                     System.out.printf("%s ",nextType);
                     int nextCapacity= inputStream.nextInt();
                     System.out.printf("%d ", nextCapacity);
                     Map&lt;String, Integer&gt; requests=new HashMap&lt;String, Integer&gt;(); 
                     requests.put(nextType,nextCapacity); 
  
                  }
  </code></pre>