Package java.util

Examples of java.util.Iterator


      // I'VE INTRODUCED A HACK HERE, TO ACCOUNT FOR CASES IN WHICH WE'RE TRYING
      // TO VIEW A MESSAGE DETAILS, BUT WE HAVEN'T COME FROM THE EMAIL LIST SCREEN.
      if (displaylistSession != null && (displaylistSession.getListType()).equals("Email"))
      {
        Set listkey = displaylistSession.keySet();
        Iterator it = listkey.iterator();

        while (it.hasNext())
        {
          index++;
          String str = (String)it.next();
          ListElement ele = (ListElement)displaylistSession.get(str);
          ListElementMember sm = (ListElementMember)ele.get("MessageID");
          Integer id = (Integer)sm.getMemberValue();
          int messageid = id.intValue();
View Full Code Here


      }
     
      if (typeOfOperation != null && typeOfOperation.equals("REMOVEITEM")) {
        String removeIDs = request.getParameter("removeID");
        StringTokenizer st;
        Iterator itr;
        Vector removeKeys = new Vector();
       
        ((OrderForm)form).convertArrayToItemLines();
        ((OrderForm)form).convertFormbeanToValueObject("edit");
       
        ItemLines itemLines = ((OrderForm)form).getItemLines();
        if (itemLines != null) {
          st = new StringTokenizer(removeIDs, ",");
          while (st.hasMoreTokens()) {
            String str = st.nextToken();
            int removeToken = Integer.parseInt(str);
           
            itr = itemLines.keySet().iterator();
            while (itr.hasNext()) {
              Object obj = itr.next();
              ItemElement ILE = (ItemElement)itemLines.get(obj);
              IntMember ItemId = (IntMember)ILE.get("ItemId");
              Integer currItemId = (Integer)ItemId.getMemberValue();
              if (currItemId.intValue() == removeToken) {
                String status = ILE.getLineStatus();
                if (status.equals("Active")) {
                  ILE.setLineStatus("Deleted");
                } else if (status.equals("New")) {
                  removeKeys.add(obj);
                }
              }
            }
          }   // end while (st.hasMoreTokens())
         
          for (int i = 0; i < removeKeys.size(); i++) {
            itemLines.remove(removeKeys.get(i));
          }
        }
       
        ((OrderForm)form).setJurisdictionVec(taxJurisdiction);
        ((OrderForm)form).setItemLines(itemLines);
        request.setAttribute("ItemLines",itemLines);
      }
     
      if (typeOfOperation != null && typeOfOperation.equals("ADDITEM")) {
        String newItemID = request.getParameter("theitemid");
        ItemList IL = null;
        ListGenerator lg = ListGenerator.getListGenerator(dataSource);
        IL = (ItemList)lg.getItemList(individualID, 1, 10, "", "ItemID");
       
        OrderForm orderForm = (OrderForm)form;
        orderForm.convertArrayToItemLines();
        orderForm.convertFormbeanToValueObject("edit");
       
        StringTokenizer st;
        String token, nextItr;
       
        if (newItemID != null) {
          st = new StringTokenizer(newItemID, ",");
          ItemLines itemLines = (orderForm).getItemLines();
          Integer intJurisdictionID = (orderForm).getJurisdictionID();
          int jurisdictionID = intJurisdictionID.intValue();
         
          if (itemLines == null) {
            itemLines = new ItemLines();
          }
          int counter = itemLines.size();
         
          while (st.hasMoreTokens()) {
            token = (String)st.nextToken();
            int intToken = Integer.parseInt(token);
           
            Iterator itr = IL.keySet().iterator();
            while (itr.hasNext()) {
              nextItr = (String)itr.next();
              ListElement ile = (ListElement)IL.get(nextItr);
              IntMember smid = (IntMember)ile.get("ItemID");
              Integer listItemid = (Integer)smid.getMemberValue();
             
              if (listItemid.intValue() == intToken) {
View Full Code Here

      IndividualList DL = lg.getIndividualList(individualID, 1, 0, "", "Name", dbID);

      DL.setTotalNoOfRecords(DL.size());
      Set s = DL.keySet();
      Iterator it = s.iterator();
      while (it.hasNext()) {
        String lim = (String)it.next();
        ListElement ile = (ListElement)DL.get(lim);
        StringMember smName = (StringMember)ile.get("Name");
        String name = (String)smName.getMemberValue();
        IntMember smid = (IntMember)ile.get("IndividualID");
        int id = new Integer(smid.getMemberValue().toString()).intValue();
        // attendeeList.addElement(new DDNameValue(id,name));
        attendeeList.addElement(new DDNameValue("" + id + "#" + name, name));
      }
      put("attendee", attendeeList);
    } else if (listType.equals("allindividual")) {
      IndividualList DL = lg.getIndividualList(individualID, 0, 0, "", "Name");
      DL.setTotalNoOfRecords(DL.size());
      Set s = DL.keySet();
      Iterator it = s.iterator();
      while (it.hasNext()) {
        String lim = (String)it.next();
        ListElement ile = (ListElement)DL.get(lim);
        StringMember smName = (StringMember)ile.get("Name");
        String name = (String)smName.getMemberValue();
        IntMember smid = (IntMember)ile.get("IndividualID");
        int id = new Integer(smid.getMemberValue().toString()).intValue();
View Full Code Here

    //System.out.println("folderid"+folderid);


    Set listkey = fl.keySet();
    Iterator it = listkey.iterator();
    while(it.hasNext())
    {
      AccountDetail ad1 =(AccountDetail)fl.get(it.next());

      String accountAddress = ad1.getAccountaddress();
      ArrayList folderList = ad1.getFolderList() ;

      int parentID = 0;
View Full Code Here

      IndividualList employeeList = new IndividualList();

      // ok, now that we have the results from the database,
      // we need to generate a DisplayList object to pass
      // to the List View code (List.jsp)
      Iterator iter = sqlResults.iterator();

      while (iter.hasNext()) {
        HashMap sqlRow = (HashMap)iter.next();

        String individualName = (String)sqlRow.get("Name");
        int individualID  = ((Number)sqlRow.get("IndividualID")).intValue();

        IntMember individualIDfield = new IntMember("IndividualID", individualID, 10, "", 'T', false, 10);
View Full Code Here

  public String getTagsFromItemLines(ItemLines itemLines, String tagName)
  {
    String qbTags = "";

    Set listkey = itemLines.keySet();
    Iterator it = listkey.iterator();
    String itemExternalID = "";
    int id = 0;
    String fmt = "0.00#";
    DecimalFormat df = new DecimalFormat(fmt, new DecimalFormatSymbols(Locale.US));

    Integer itemID = new Integer(1);

    while (it.hasNext())
    {

      Object obj = it.next();

      itemID = Integer.valueOf(obj.toString());

      ItemElement ele = (ItemElement)itemLines.get(itemID.toString());
View Full Code Here

  */
  public ExpenseList setLinksfunction( ExpenseList DL )
  {
    String url = null;
    Set listkey = DL.keySet();
    Iterator it =  listkey.iterator();
    while( it.hasNext() )
    {
      try
      {
        String str = ( String )it.next();

        StringMember sm = null;
        ListElement ele  = ( ListElement )DL.get( str );

        IntMember intExpenseID = (IntMember)ele.get("ExpenseID");
View Full Code Here

        Collection sqlResults = remote.getEmployeeListCollection(individualID);

        // ok, now that we have the results from the database,
        // we need to generate a DisplayList object to pass
        // to the List View code (List.jsp)
        Iterator iter = sqlResults.iterator();

        while (iter.hasNext()) {
          HashMap sqlRow = (HashMap)iter.next();
          String indvName = (String)sqlRow.get("Name");
          int indvID = ((Number)sqlRow.get("IndividualID")).intValue();
          attendeeVec.addElement(new DDNameValue("" + indvID + "#" + indvName, indvName));
        }
      } else if (dbName != null && dbName.equals("individual")) {
View Full Code Here

                ticketForm.setWebsite(primaryAdd.getWebsite());
              }
            }
           
            Collection mocList = entityVO.getMOC();
            Iterator iterator = mocList.iterator();
            while (iterator.hasNext()) {
              MethodOfContactVO moc  = (MethodOfContactVO) iterator.next();
              if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
                ticketForm.setEmail(moc.getContent());
              } else if (moc.getMocType() == 4) {
                ticketForm.setPhone(moc.getContent());
              }
View Full Code Here

        }
        StringBuffer sb = new StringBuffer();

        // If a collection was specified, use that mode to render options
        if (collection != null) {
            Iterator collIterator = getIterator(collection, null);
            while (collIterator.hasNext()) {

                Object bean = collIterator.next();
                Object value = null;
                Object label = null;

                try {
                    value = PropertyUtils.getProperty(bean, property);
                    if (value == null) {
                        value = "";
                    }
                } catch (IllegalAccessException e) {
                    throw new JspException(
                        messages.getMessage("getter.access", property, collection));
                } catch (InvocationTargetException e) {
                    Throwable t = e.getTargetException();
                    throw new JspException(
                        messages.getMessage("getter.result", property, t.toString()));
                } catch (NoSuchMethodException e) {
                    throw new JspException(
                        messages.getMessage("getter.method", property, collection));
                }

                try {
                    if (labelProperty != null) {
                        label = PropertyUtils.getProperty(bean, labelProperty);
                    } else {
                        label = value;
                    }

                    if (label == null) {
                        label = "";
                    }
                } catch (IllegalAccessException e) {
                    throw new JspException(
                        messages.getMessage("getter.access", labelProperty, collection));
                } catch (InvocationTargetException e) {
                    Throwable t = e.getTargetException();
                    throw new JspException(
                        messages.getMessage("getter.result", labelProperty, t.toString()));
                } catch (NoSuchMethodException e) {
                    throw new JspException(
                        messages.getMessage("getter.method", labelProperty, collection));
                }


        String stringValue = value.toString();
        if (fieldRight > 0 && fieldRight == ModuleFieldRightMatrix.VIEW_RIGHT ) {
          if(selectTag.isMatched(stringValue)){
            addOption(sb, stringValue, label.toString(), selectTag.isMatched(stringValue));
          }
        }
        if (fieldRight > 0 && fieldRight == ModuleFieldRightMatrix.NONE_RIGHT) {
          if(selectTag.isMatched(stringValue)){
            addOption(sb, "0", " ", selectTag.isMatched(stringValue));
          }
        }

        else{
          addOption(sb, stringValue, label.toString(), selectTag.isMatched(stringValue));
        }


            }

        }

        // Otherwise, use the separate iterators mode to render options
        else {

            // Construct iterators for the values and labels collections
            Iterator valuesIterator = getIterator(name, property);
            Iterator labelsIterator = null;
            if ((labelName == null) && (labelProperty == null)) {
                labelsIterator = getIterator(name, property); // Same coll.
            } else {
                labelsIterator = getIterator(labelName, labelProperty);
            }

            // Render the options tags for each element of the values coll.
            while (valuesIterator.hasNext()) {
                Object valueObject = valuesIterator.next();
                if (valueObject == null) {
                    valueObject = "";
                }
                String value = valueObject.toString();
                String label = value;
                if (labelsIterator.hasNext()) {
                    Object labelObject = labelsIterator.next();
                    if (labelObject == null) {
                        labelObject = "";
                    }
                    label = labelObject.toString();
                }
View Full Code Here

TOP

Related Classes of java.util.Iterator

Copyright © 2015 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.