Chapter 15 608 During parsing, we maintain the trip number of the latest trip. This is used by VacationApplet to determine the delta update that it needs whenever it contacts the server. The getMaxTripNumber() method allows the VacationApplet to obtain this number. Only trips newer than those already sent, as indicated by the maxTripNumber, will be included in the sell-off transmission.   public int getMaxTripNumber() {     return maxTripNumber;   } DumpDeals() is a debug method used in testing DealsParser. It works in conjunction with the main() method and parses a testfile.xml URL in order to test parsing functionality:   public void DumpDeals() {     TravelDeal curDeal;     for (int i = 0; i < myDeals.size(); i++) {       curDeal = ((TravelDeal) myDeals.elementAt(i));       System.out.println("Deals #" + (i + 1) + " is "                          + curDeal.getDescription() + "(Comm: $"                          + curDeal.getCommission() + ", Region:"                          + curDeal.getRegion() + ")");     }   }   public static void main(String args[]) {     DealsParser myParser = new DealsParser();     URL myURL = null;     try {       myURL = new URL("http://localhost:8080/vacdeal/testfile.xml");     } catch (Exception e) {       e.printStackTrace();     }     myParser.parse(myURL);     myParser.DumpDeals();   } We have two parse() methods. The first one is used by VacationApplet and takes the XML to be parsed as a string argument. The second variation parses the XML from a URL. Both of them will instantiate the Ælfred SAX2 parser to perform parsing.   public Vector parse(String inXML) {     try {       parser = new XmlParser();       InputStream myInput = new ByteArrayInputStream(inXML.getBytes());       parser.setHandler(this);       parser.parse(null, null, myInput, null);     } catch (Exception se) {       se.printStackTrace();     }     return myDeals;   }