Package org.apache.xmlbeans.samples.enumeration.schemaenum.pricesummary

Examples of org.apache.xmlbeans.samples.enumeration.schemaenum.pricesummary.ItemType


            LineItem item = items[i];

            if (item.getPrice() < 10.00)
            {

                ItemType newItem = priceZero.addNewItem();
                newItem.setTitle(item.getDescription());
                newItem.xsetQuantity(item.xgetQuantity());
                newItem.setAmount(item.getPrice());

            } else if (item.getPrice() >= 10.00 && item.getPrice() < 20.00)
            {

                ItemType newItem = priceTen.addNewItem();
                newItem.setTitle(item.getDescription());
                newItem.xsetQuantity(item.xgetQuantity());
                newItem.setAmount(item.getPrice());

            } else if (item.getPrice() >= 20.00)
            {

                ItemType newItem = priceTwenty.addNewItem();
                newItem.setTitle(item.getDescription());
                newItem.xsetQuantity(item.xgetQuantity());
                newItem.setAmount(item.getPrice());
            }
        }
        return summaryDoc;
    }
View Full Code Here


            // Loop through the <item> elements, discovering which threshold
            // the item belongs to, then using the element's <title> value
            // in in a sorted list.
            for (int j = 0; j < itemElements.length; j++)
            {
                ItemType item = itemElements[j];

                // For each <item> element, find out the int value of its <price>
                // parent element's threshold attribute value. Append the item's
                // title to the appropriate string buffer.
                switch (priceElements[i].getThreshold().intValue())
                {

                    case PriceType.Threshold.INT_BELOW_10_DOLLARS:
                        zeroBuffer.append(" " + item.getTitle() + "\n");
                        break;

                    case PriceType.Threshold.INT_BETWEEN_10_AND_20_DOLLARS:
                        tenBuffer.append(" " + item.getTitle() + "\n");
                        break;

                    case PriceType.Threshold.INT_ABOVE_20_DOLLARS:
                        twentyBuffer.append(" " + item.getTitle() + "\n");
                        break;

                    default:
                        System.out.println("Yo! Something unexpected happened!");
                        break;
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.samples.enumeration.schemaenum.pricesummary.ItemType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.