Package sg.edu.nus.iss.se07.common

Examples of sg.edu.nus.iss.se07.common.Tuple3


                                if (contents == null) {
                                        return null;
                                }
                                String[] lines = StringUtil.parse(contents, format.getEndOfLineSymbols());
                                if (lines == null) {
                                        throw new DataAccessException("[CategoryDA::readData]Record not found.");
                                } else {

                                        if (lines.length < 1) {
                                                throw new DataAccessException("[CategoryDA::readData]Record not found.");
                                        }

                                        dataObjectSet = new ArrayList<Tuple2<NameValue<String>, NameValue<String>>>();
                                        for (int i = 0; i < lines.length; i++) {
                                                String record = lines[i];
                                                String[] fields = StringUtil.parse(record, String.valueOf((char) format.getDelimiterChar()));
                                                if (fields == null) {
                                                        throw new DataAccessException("[CategoryDA::readData]Unable to read record no " + (String.valueOf(i + 1)));
                                                } else {
                                                        if (fields.length != 2) {
                                                                Logger.getLogger(CategoryDA.class.getName()).log(Level.SEVERE, "[CategoryDA::readData]Record no " + (String.valueOf(i + 1)) + " is corrupted");
                                                        } else {
                                                                NameValue<String> categoryCode = new NameValue<String>("CategoryCode", fields[0]);
                                                                NameValue<String> categoryName = new NameValue<String>("CategoryName", fields[1]);
                                                                dataObjectSet.add(new Tuple2<NameValue<String>, NameValue<String>>(categoryCode, categoryName));
                                                        }
                                                }
                                        }
                                }
                        } else {
                                throw new DataAccessException("[CategoryDA::readData]File not found.");
                        }
                } catch (IOException ex) {
                        throw new DataAccessException(ex.getMessage(), ex);
                } finally {
                        if (br != null) {
                                try {
                                        br.close();
                                } catch (IOException ex) {
View Full Code Here


                                NameValue<String> nmMemberID = new NameValue<String>("MemberID", memberID);
                                NameValue<String> nmMemberName = new NameValue<String>("MemberName", memberName);
                                NameValue<Integer> nmMemberPoint = new NameValue<Integer>("MemberPoint", memberPoint);

                                Tuple3<NameValue<String>, NameValue<String>, NameValue<Integer>> dataObject = new Tuple3(nmMemberID, nmMemberName, nmMemberPoint);
                                newDataObjectSet.add(dataObject);
                        }


                        try {
View Full Code Here

                               
                                if (!memberID.equalsIgnoreCase(memberCode)) {
                                        NameValue<String> nmMemberID = new NameValue<String>("MemberID", memberID);
                                        NameValue<String> nmMemberName = new NameValue<String>("MemberName", memberName);
                                        NameValue<Integer> nmMemberPoint = new NameValue<Integer>("MemberPoint", memberPoint);
                                        Tuple3<NameValue<String>, NameValue<String>, NameValue<Integer>> dataObject = new Tuple3(nmMemberID, nmMemberName, nmMemberPoint);
                                        newDataObjectSet.add(dataObject);
                                }

                        }
View Full Code Here

         * @param product
         * @return
         * @throws AppException
         */
        public ErrorList create(Product product) throws AppException {
                ErrorList errorList = new ErrorList();

                ProductSet productSet = null;
                try {
                        productSet = list(product.getProductID());
                } catch (AppException ex) {
                        errorList.addError("[ProductManager::create]", ex.getMessage());
                }

                if (productSet != null) {
                        if (productSet.length() != 0) {
                                //means product code is exist, do not allow duplicate product code
                                errorList.addError(MEMBER_DUPLICATE_ENTRY);
                                return errorList;
                        }
                }

                try {
View Full Code Here

                return errorList;
        }

        public ErrorList update(Product newCategory, Product oldCategory) {
                ErrorList errorList = new ErrorList();
                return errorList;
        }
View Full Code Here

                ErrorList errorList = new ErrorList();
                return errorList;
        }

        public ErrorList delete(Product product) throws AppException {
                ErrorList errorList = new ErrorList();
                return errorList;
        }
View Full Code Here

                ErrorList errorList = new ErrorList();
                return errorList;
        }

        public ErrorList delete(String productID) throws AppException {
                ErrorList errorList = new ErrorList();
                return errorList;
        }
View Full Code Here

         * @param product
         * @return
         * @throws AppException
         */
        public ErrorList create(Product product) throws AppException {
                ErrorList errorList = new ErrorList();

                ProductSet productSet = null;
                try {
                        productSet = list(product.getProductID());
                } catch (AppException ex) {
                        errorList.addError("[ProductManager::create]", ex.getMessage());
                }

                if (productSet != null) {
                        if (productSet.length() != 0) {
                                //means product code is exist, do not allow duplicate product code
                                errorList.addError(MEMBER_DUPLICATE_ENTRY);
                                return errorList;
                        }
                }

                try {
View Full Code Here

                return errorList;
        }

        public ErrorList update(Product newCategory, Product oldCategory) {
                ErrorList errorList = new ErrorList();
                return errorList;
        }
View Full Code Here

                ErrorList errorList = new ErrorList();
                return errorList;
        }

        public ErrorList delete(Product product) throws AppException {
                ErrorList errorList = new ErrorList();
                return errorList;
        }
View Full Code Here

TOP

Related Classes of sg.edu.nus.iss.se07.common.Tuple3

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.