Package java.util

Examples of java.util.StringTokenizer


    return month;
  }

  private Vector getTime(String sfromDate)
  {
    StringTokenizer stok = new StringTokenizer(sfromDate, " ");
    int i = 0;
    Vector vecTime1 = new Vector();
    Vector vecTime2 = new Vector();

    while (stok.hasMoreTokens())
    {
      String sToken = stok.nextToken();
      vecTime1.add(sToken);
    }

    String stok1 = (String) vecTime1.get(0);
    StringTokenizer sTokens1 = new StringTokenizer(stok1, ":");

    while (sTokens1.hasMoreTokens())
    {
      String sToken = sTokens1.nextToken();
      vecTime2.add(sToken);
    }
    return vecTime2;
  }
View Full Code Here


      EmailFacadeHome aa             = (EmailFacadeHome) CVUtility.getHomeObject("com.centraview.email.emailfacade.EmailFacadeHome", "EmailFacade");
      EmailFacade remote             = (EmailFacade) aa.create();
      remote.setDataSource(dataSource);
     
      //to
      StringTokenizer st             = new StringTokenizer(mailTo, ",");
      while (st.hasMoreTokens())
      {
        String addr = st.nextToken();
      ArrayList al = new ArrayList();
      if(addr!=null)
      {
        al.add(new MailAddress(addr));
        mailmessage.setTo(al);
View Full Code Here

      Remove item
      */
      if(typeOfOperation != null &&  typeOfOperation.equals("REMOVEITEM") )
      {
        String removeIDs = request.getParameter("removeID");
        StringTokenizer st;
        Iterator itr;
        Vector removeKeys = new Vector();

        itemLines = expenseForm.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)

        expenseForm.setItemLines(itemLines);
        request.setAttribute("expenseform",expenseForm);

      }// end of 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 = (expenseForm).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();
View Full Code Here

      String messageBody = (String)session.getAttribute("emailmessage");
      DynaActionForm dynaForm = (DynaActionForm)form;

      GlobalMasterLists gml = GlobalMasterLists.getGlobalMasterLists(dataSource);

      StringTokenizer st = new StringTokenizer(messageBody, Constants.EH_HEADER_DELIMETER);

      while (st.hasMoreTokens())
      {
        String fullHeader = st.nextToken();

        String strhead = (fullHeader.substring(0, fullHeader.indexOf(Constants.EH_KEYVALUE_DELEMETER))).trim();
        String strValue = (fullHeader.substring(fullHeader.indexOf(Constants.EH_KEYVALUE_DELEMETER) + 1)).trim();

        if (strhead.equals("street1"))
View Full Code Here

      this.start = startI;
      this.end = endI;
      this.rule = ruleI;

      ArrayList ruleList = new ArrayList();
      StringTokenizer stk = new StringTokenizer(rule,";");

      //===== READ the rules that have been provided and make the meta-sets and instructions
      //===== that will be needed later.
      while ( stk.hasMoreTokens() ){
        String curRule = stk.nextToken();
        ruleList.add(curRule);
        String key = curRule.substring(0,curRule.indexOf("="));
        String value = curRule.substring(curRule.indexOf("=")+1);
        //println("  "+key+"  =  "+value);
View Full Code Here

  split a list into validated numbers
  ***/
  private HashSet getNumberSet(String list, int low, int high, String key)
  {
    HashSet result = new HashSet();
    StringTokenizer stk = new StringTokenizer(list,",");
    while ( stk.hasMoreTokens() ){
      int cur = Integer.parseInt(stk.nextToken());
      //--- be in range
      if ( cur<low || cur>high ){
        throw new IllegalArgumentException("ERROR: invalid integer list: "+key);
      }
      //--- if low != 0 then 0 is disallowed
View Full Code Here

  split a list into validated ByDay objects
  ***/
  private HashSet getWeekDaySet(String list)
  {
    HashSet result = new HashSet();
    StringTokenizer stk = new StringTokenizer(list,",");
    while ( stk.hasMoreTokens() ){
      ByDay bd = new ByDay(stk.nextToken());
      if ( bd.count != 0 &&
           !( "MONTHLY".equals(freq) || "YEARLY".equals(freq) ) ) {
        throw new IllegalArgumentException("  ERROR: You can only specify a number with a week day in the YEARLY or MONTHLY frequencies.");
      }
      result.add( bd );
View Full Code Here

 
 
 
  private  Vector getDate(String sfromDate)
  {
    StringTokenizer stok = new StringTokenizer(sfromDate,"-");
    String[] sTokens = new String[]{};
    int i = 0;
    Vector  vecDate = new Vector();
    while (stok.hasMoreTokens())
    {
      String sToken = stok.nextToken();
      vecDate.add(sToken);
    }
    return vecDate;
 
View Full Code Here

    return mapping.findForward(returnStatus);
  }

  private Vector getDate(String sfromDate)
  {
    StringTokenizer stok = new StringTokenizer(sfromDate, "-");
    String[] sTokens = new String[] {};
    int i = 0;
    Vector vecDate = new Vector();
    while (stok.hasMoreTokens())
    {
      String sToken = stok.nextToken();
      vecDate.add(sToken);
    }
    return vecDate;
  }
View Full Code Here

      String typeOfOperation = request.getParameter(AccountConstantKeys.TYPEOFOPERATION);
     
      if (typeOfOperation != null && typeOfOperation.equals("REMOVEITEM")) {
        // Remove item
        String removeIDs = request.getParameter("removeID");
        StringTokenizer st;
        Iterator itr;
        Vector removeKeys = new Vector();
       
        orderForm.convertArrayToItemLines();
        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);
                }
              }
            }
          }
         
          for (int i=0; i < removeKeys.size(); i++) {
            itemLines.remove(removeKeys.get(i));
          }
        }
       
        ((OrderForm)form).setItemLines(itemLines);
      } 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
       
        orderForm.convertArrayToItemLines();
        orderForm.convertFormbeanToValueObject("add");
       
        StringTokenizer st;
        String token, nextItr;
        if (newItemID != null) {
          st = new StringTokenizer(newItemID, ",");
          itemLines = (orderForm).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();
View Full Code Here

TOP

Related Classes of java.util.StringTokenizer

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.