public class BestDeal extends Object
| Modifier and Type | Field and Description |
|---|---|
int |
delivery |
protected static String |
MESSAGE |
protected static String |
NAMESPACE_URI |
double |
price
properties we are collecting: best price, delivery time,
product and vendor names
|
String |
product |
protected int |
targetDelivery
target delivery value (refuse elements above this target)
|
String |
vendor |
| Constructor and Description |
|---|
BestDeal(int td)
creates an "empty" BestDeal with the given target for delivery
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkVendor(XmlPullParser parser)
subroutine handling a single vendor
|
static void |
main(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
|
protected static final String MESSAGE
protected static final String NAMESPACE_URI
public double price
public int delivery
public String product
public String vendor
protected int targetDelivery
public BestDeal(int td)
td - the target for deliverypublic void update(XmlPullParser parser) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionpublic void checkVendor(XmlPullParser parser) throws IOException, XmlPullParserException
IOExceptionXmlPullParserExceptionpublic static void main(String[] args) throws IOException, XmlPullParserException
args - command-line argumentIOExceptionXmlPullParserExceptionCopyright © 2013. All Rights Reserved.