Class BestDeal


  • public class BestDeal
    extends java.lang.Object
    Rewritten http://www-106.ibm.com/developerworks/xml/library/x-saxapi/listing4.html to make easy to comapre how to "natutal is to manage state with SAX and with XMLPULL API. For details see: http://www-106.ibm.com/developerworks/xml/library/x-saxapi/
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int delivery  
      protected static java.lang.String MESSAGE  
      protected static java.lang.String NAMESPACE_URI  
      double price
      properties we are collecting: best price, delivery time, product and vendor names
      java.lang.String product  
      protected int targetDelivery
      target delivery value (refuse elements above this target)
      java.lang.String vendor  
    • Constructor Summary

      Constructors 
      Constructor Description
      BestDeal​(int td)
      creates an "empty" BestDeal with the given target for delivery
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkVendor​(XmlPullParser parser)
      subroutine handling a single vendor
      static void main​(java.lang.String[] args)
      main() method decodes command-line parameters and invoke the parser
      void update​(XmlPullParser parser)
      updates the best deal from the given list in the format
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • price

        public double price
        properties we are collecting: best price, delivery time, product and vendor names
      • delivery

        public int delivery
      • product

        public java.lang.String product
      • vendor

        public java.lang.String vendor
      • targetDelivery

        protected int targetDelivery
        target delivery value (refuse elements above this target)
    • Constructor Detail

      • BestDeal

        public BestDeal​(int td)
        creates an "empty" BestDeal with the given target for delivery
        Parameters:
        td - the target for delivery