Package java.util

Examples of java.util.Iterator


 

  public int getMaxLineId()
  {
    Set s = this.keySet();
    Iterator itr = s.iterator();
    int maxId =0;
    while (itr.hasNext())
    {
      AccountingLineElement ale = (AccountingLineElement) this.get(itr.next());
      int currid = ale.getElementId();
      maxId = Math.max(maxId,currid);     
   
    }//while
    return maxId;
View Full Code Here


  public void sort()
  {
    TreeMap tmp = new TreeMap();
    Set s = this.keySet();
    Iterator itr = s.iterator();
    String sortMember = this.getSortMember();
    AccountingLineElement curr = null;
    while(itr.hasNext())
    {
      try
        {
          curr = (AccountingLineElement)this.get(itr.next());
          String newSortStr = ((ListElementMember)curr.get(sortMember)).getSortString() + curr.getElementId();
          tmp.put(newSortStr,curr);
        }//try
      catch(Exception e)
        {
View Full Code Here

      }//end of if ( typeOfOperation != null &&  typeOfOperation.equals("ShowPurchaseOrder"))
      else if ( typeOfOperation != null && typeOfOperation.equals("REMOVEITEM") )
      {
        String removeIDs = request.getParameter("removeID");
        StringTokenizer st;
        Iterator itr;
        Vector removeKeys = new Vector();

        itemLines = ((PurchaseOrderForm)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");
                }//end of if (status.equals("Active"))
                else if (status.equals("New"))
                {
                  removeKeys.add(obj);
                }// end of else if (status.equals("New"))
              }//end of if ( currItemId.intValue() == removeToken)
            }//end of while (itr.hasNext())
          }//end of while (st.hasMoreTokens())

          for(int i=0; i<removeKeys.size(); i++)
          {
            itemLines.remove(removeKeys.get(i));
          }// end of for(int i=0; i<removeKeys.size(); i++)
        }// end of if (itemLines != null)

        ((PurchaseOrderForm)form).setItemLines(itemLines);
        request.setAttribute(AccountConstantKeys.TYPEOFOPERATION,"REMOVEITEM");
      }//end of else if ( typeOfOperation != null && typeOfOperation.equals("REMOVEITEM") )
      /*ADD item*/
      else if ( typeOfOperation != null && typeOfOperation.equals("ADDITEM") )
      {

        String newItemID = request.getParameter("theitemid");
        ItemList IL = null ;
        ListGenerator lg = ListGenerator.getListGenerator(dataSource);//get the List Generator object for Listing
        IL = (ItemList )lg.getItemList( individualID , 1, 10 , "" , "ItemID");//called when the request for the list is for first time

        StringTokenizer st;
        String token, nextItr;

        if (newItemID != null)
        {
          st = new StringTokenizer(newItemID, ",");
          itemLines = ((PurchaseOrderForm)form).getItemLines();

          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

      DL.setTotalNoOfRecords( DL.size() );

      System.out.println("san-OrderLookupHandler-got the DL, size = "+DL.size());

      Set listkey = DL.keySet();
      Iterator it =  listkey.iterator();
      /*while( it.hasNext() )
      {
        String str = ( String )it.next();
        System.out.println(str);
        StringMember sm=null;
View Full Code Here

    int id = Integer.parseInt( accountid );

    /** code added for query change **/
    FolderList fl = ( FolderList )session.getAttribute("folderlist");
    Set listkey = fl.keySet();
    Iterator it = listkey.iterator();
    int accountID;
    AccountDetail ad1 = null;
    while(it.hasNext())
    {
      ad1 =(AccountDetail)fl.get(it.next());
      accountID = ad1.getAccountid();
      if( id == accountID )
      break;

    }
View Full Code Here

      // use in the rest of this handler...
      ArrayList validFields = mailRemote.getValidFields("Contact");
      HashMap contactForm = new HashMap();
      if (validFields != null && validFields.size() > 0)
      {
        Iterator iter = validFields.iterator();
        while (iter.hasNext())
        {
          HashMap validFieldMap = (HashMap)iter.next();
          String name = (String)validFieldMap.get("name");
          String fieldName = (String)validFieldMap.get("fieldName");
          String value = request.getParameter(fieldName);
          if (value == null){ value = ""; }
          contactForm.put(fieldName, value);
View Full Code Here

  This function sets links on members
  */
  public void setLinks(DisplayList DL )
  {
     Set listkey = DL.keySet();
     Iterator it =  listkey.iterator();
        while( it.hasNext() )
         {
       String str = ( String )it.next();
      StringMember sm=null;
          ListElement ele  = ( ListElement )DL.get( str );

      IntMember im = (IntMember) ele.get("ID");
      im.setRequestURL("openWindow('ViewTimeSlipDetail.do?rowId="+((Integer)im.getMemberValue()).intValue()+"&listId="+DL.getListID()+"'"+",'', 740,  335,'scrollbars=yes')");
View Full Code Here

  private void addCustomFields(ContactVO contactVO, ArrayList validCustomFields, HashMap contactForm)
  {
    if (validCustomFields != null && validCustomFields.size() > 0)
    {
      Iterator cfIter = validCustomFields.iterator();
      // loop through valid CF's...
      while (cfIter.hasNext())
      {
        HashMap fieldInfo = (HashMap)cfIter.next();
        Number fieldID = (Number)fieldInfo.get("fieldID");
        String fieldName = (String)fieldInfo.get("fieldName");
       
        // now that we have the field name, we can get the form
        // value for each valid custom field...
View Full Code Here

  {

    String url = "";

    Set listkey = DL.keySet();
    Iterator it = listkey.iterator();
    while (it.hasNext())
    {
      try
      {
        String str = (String)it.next();

        ListElement ele = (ListElement)DL.get(str);

        //sets the URL for this member
        IntMember invoice = (IntMember)ele.get("InvoiceID");
View Full Code Here

          if (primaryAdd.getWebsite() != null) {
            ticketForm.setWebsite(primaryAdd.getWebsite());
          }
        }

        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

TOP

Related Classes of java.util.Iterator

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.