Examples of StringTokenizer


Examples of java.util.StringTokenizer

    m_orderBy.clear();
   
    m_inc = Utils.getFlag('I', options);
   
    if(m_inc){
        StringTokenizer st = new StringTokenizer(keyString, ",");
        while (st.hasMoreTokens()) {
            String column = st.nextToken();
            column = column.replaceAll(" ","");
            m_orderBy.add(column);
        }
    }
  }
View Full Code Here

Examples of java.util.StringTokenizer

     */
    public static String[] split(String str, String delim) {
        if (str == null) {
            return new String[0];
        }
        StringTokenizer st = new StringTokenizer(str, delim);
        String[] s = new String[st.countTokens()];
        for (int i=0; i<s.length; i++) {
            s[i] = st.nextToken();
        }
        return s;
    }
View Full Code Here

Examples of java.util.StringTokenizer

    int                     targetPos;
    String                  event;
    boolean                 hidden;
    Vector                  conns;
    BeanConnection          conn;
    StringTokenizer         tok;
    Vector                  beanconns;

    conns = (Vector) m_BeanConnectionRelation.get(key);
   
    // no connections?
    if (conns == null)
      return;
   
    for (n = 0; n < conns.size(); n++) {
      tok       = new StringTokenizer(conns.get(n).toString(), ",");
      conn      = null;
      sourcePos = Integer.parseInt(tok.nextToken());
      targetPos = Integer.parseInt(tok.nextToken());
      event     = tok.nextToken();
      hidden    = stringToBoolean(tok.nextToken());

      // regular connection? -> new instance
      // or MetaBean from user toolbar
      if ( (!(key instanceof MetaBean)) || (getDataType() == DATATYPE_USERCOMPONENTS)) {
        conn = createBeanConnection(sourcePos, targetPos, event, hidden);
View Full Code Here

Examples of java.util.StringTokenizer

    String    str,
    int      length )
  {
    String  res = "";
   
    StringTokenizer tok = new StringTokenizer(str, "\n");
   
    while( tok.hasMoreTokens()){
     
      String  line = tok.nextToken();
     
      while( line.length() > length ){
     
        if ( res.length() > 0 ){
         
View Full Code Here

Examples of java.util.StringTokenizer

    public static String getSubHeader(String header, String subHeaderName) {
        if (header == null) {
            return null;
        }

        StringTokenizer headerTokenizer = new StringTokenizer(header, ";");

        while (headerTokenizer.hasMoreTokens()) {
            String token = headerTokenizer.nextToken().trim();
            int i = token.indexOf("=");

            if (i > 0) {
                String hname = token.substring(0, i).trim();
View Full Code Here

Examples of java.util.StringTokenizer

            reader = new BufferedReader(new StringReader(resource.getContent()));

            String line = reader.readLine();

            while (line != null) {
                StringTokenizer st = new StringTokenizer(line, ":");

                if (st.countTokens() > 1) {
                    users.put(st.nextToken(), st.nextToken());
                }

                line = reader.readLine();
            }
        } catch (Exception ignore) {
View Full Code Here

Examples of java.util.StringTokenizer

                        nextPart.content = nextPart.content.substring(0,
                                                                      nextPart.content.length() -
                                                                      1);
                }

                StringTokenizer st = new StringTokenizer(nextPart.content, "\r\n", true);
                String nextLine = st.hasMoreTokens() ? st.nextToken() : null;

                // count newLines we "swallow", see explanation below
                int newLineCount = 0;

                templateBody.append("res.write (");

                if (nextPart.isStatic) {
                    templateBody.append("\"");
                }

                while (nextLine != null) {
                    if ("\n".equals(nextLine)) {
                        // append a CRLF
                        newLineCount++;
                        templateBody.append("\\r\\n");
                    } else if (!"\r".equals(nextLine)) {
                        try {
                            StringReader lineReader = new StringReader(nextLine);
                            int c = lineReader.read();

                            while (c > -1) {
                                if (nextPart.isStatic &&
                                        (((char) c == '"') || ((char) c == '\\'))) {
                                    templateBody.append('\\');
                                }

                                templateBody.append((char) c);
                                c = lineReader.read();
                            }
                        } catch (IOException srx) {
                        }
                    }

                    nextLine = st.hasMoreTokens() ? st.nextToken() : null;
                }

                if (nextPart.isStatic) {
                    templateBody.append("\"");
                }
View Full Code Here

Examples of java.util.StringTokenizer

        request.setAttribute(AccountConstantKeys.TYPEOFOPERATION,"ShowPurchaseOrder");
      }//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())
            {
View Full Code Here

Examples of java.util.StringTokenizer

        }*/
        //System.out.println("strLiteratureId[0] :: "+strLiteratureId[0]);

        if (!strLiteratureId.equals(""))
        {
          StringTokenizer stid = new StringTokenizer(strLiteratureId,",");
          StringTokenizer stName = new StringTokenizer(names,",");
          String strId = "";
          String strName = "";
          while(stid.hasMoreTokens())
          {
            strId = stid.nextToken();
            strName = stName.nextToken();
            if (!strId.equals("")){
              int id = Integer.parseInt(strId);
              literaturenamevec.add(new DDNameValue(id,strName));
            }
          }
View Full Code Here

Examples of java.util.StringTokenizer

    //to
    ArrayList toarray = new ArrayList();
    String to  = (String) dynaForm.get( "composeTo" );

    StringTokenizer st = new StringTokenizer( to , "," );
    while ( st.hasMoreTokens())
    {
      toarray.add( new MailAddress( st.nextToken() ) );
    }
    mailMessage.setTo( toarray );


    //cc
    ArrayList ccarray = new ArrayList();
    String cc = (String) dynaForm.get( "composeCc" );

    StringTokenizer stcc = new StringTokenizer( cc , "," );
    while ( stcc.hasMoreTokens())
    {
      ccarray.add(new MailAddressstcc.nextToken()  ) );
    }
    mailMessage.setCc( ccarray );

    //bcc
    ArrayList bccarray = new ArrayList();
    String bcc = (String ) dynaForm.get( "composeBcc" );

    StringTokenizer stbcc = new StringTokenizer( bcc , "," );
    while ( stbcc.hasMoreTokens())
    {
      bccarray.add( new MailAddress( stbcc.nextToken() ) );
    }
    mailMessage.setBcc(bccarray);

    //message subject
    String subject = (String) dynaForm.get( "composeSubject" );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.