Package railo.commons.lang

Examples of railo.commons.lang.StringList$Entry


          }
         
         
          StringBuilder res=new StringBuilder();
         
          StringList list = ListUtil.toListTrim(path, '/');
          String str;
         
          while(list.hasNext()){
            str=list.next();
            //str=URLDecoder.decode(str);
           
            if(StringUtil.isEmpty(str)) continue;
            res.append("/");
            res.append(escapeQSValue(str));
View Full Code Here


     
   
        // query
        if(!StringUtil.isEmpty(query)){
         
          StringList list = ListUtil.toList(query, '&');
          String str;
          int index;
          char del='?';
          while(list.hasNext()){
            res.append(del);
            del='&';
            str=list.next();
            index=str.indexOf('=');
            if(index==-1)res.append(escapeQSValue(str));
            else {
              res.append(escapeQSValue(str.substring(0,index)));
              res.append('=');
View Full Code Here

 

  public static Map<String, String> parseParameterList(String _str, boolean decode,String charset) {
    //return railo.commons.net.HTTPUtil.toURI(strUrl,port);
    Map<String,String> data=new HashMap<String, String>();
    StringList list = ListUtil.toList(_str, '&');
      String str;
      int index;
      while(list.hasNext()){
        str=list.next();
        index=str.indexOf('=');
        if(index==-1){
          data.put(decode(str,decode), "");
        }
        else {
View Full Code Here

     * @param delimiter delimter of the list
     * @return Array Object
     */
    public static StringList listToStringListRemoveEmpty(String list, char delimiter) {
        int len=list.length();
        StringList rtn=new StringList();
        if(len==0) return rtn.reset();
        int last=0;
       
        for(int i=0;i<len;i++) {
            if(list.charAt(i)==delimiter) {
                if(last<i)rtn.add(list.substring(last,i));
                last=i+1;
            }
        }
        if(last<len)rtn.add(list.substring(last));

        return rtn.reset();
    }
View Full Code Here

     * @param list
     * @param delimiter
     * @return trimmed list
     */
    public static StringList toListTrim(String list, char delimiter) {
        if(list.length()==0) return new StringList();
        // remove at start
        while(list.indexOf(delimiter)==0) {
            list=list.substring(1);
        }
        int len=list.length();
        if(len==0) return new StringList();
        while(list.lastIndexOf(delimiter)==len-1) {
            list=list.substring(0,len-1<0?0:len-1);
            len=list.length();
        }
       
View Full Code Here

     * @param list
     * @param delimiter
     * @return list
     */
    public static StringList toList(String list, char delimiter) {
        if(list.length()==0) return new StringList();
        int len=list.length();
        int last=0;
       
        StringList rtn=new StringList();
      
        for(int i=0;i<len;i++) {
            if(list.charAt(i)==delimiter) {
                rtn.add(list.substring(last,i));
                last=i+1;
            }
        }
        if(last<=len)rtn.add(list.substring(last));
        rtn.reset();
        return rtn;
    }
View Full Code Here

        rtn.reset();
        return rtn;
    }
   
    public static StringList toWordList(String list) {
        if(list.length()==0) return new StringList();
        int len=list.length();
        int last=0;
        char c,l=0;
        StringList rtn=new StringList();
      
        for(int i=0;i<len;i++) {
            if(StringUtil.isWhiteSpace(c=list.charAt(i))) {
                rtn.add(list.substring(last,i),l);
                l=c;
                last=i+1;
            }
        }
        if(last<=len)rtn.add(list.substring(last),l);
        rtn.reset();
        return rtn;
    }
View Full Code Here

              name=URLDecoder.decode(name,encoding,true);
              value=URLDecoder.decode(value,encoding,true);
            }
            // MUST valueStruct
            if(name.indexOf('.')!=-1) {
                StringList list=ListUtil.listToStringListRemoveEmpty(name,'.');
                Struct parent=this;
                while(list.hasNextNext()) {
                    parent=_fill(parent,list.next(),new CastableStruct(),false,scriptProteced,sameAsArray);
                }
                _fill(parent,list.next(),value,true,scriptProteced,sameAsArray);
            }
            //else
                _fill(this,name,value,true,scriptProteced,sameAsArray);
        }
    }
View Full Code Here

  }

  public String generateSectionLabel(PieDataset pd, Comparable c) {
    String value=Caster.toString(pd.getKey(pd.getIndex(c)),"");
   
    StringList list = ListUtil.toList(value, '\n');
    StringBuffer sb=new StringBuffer();
    String line;
    int lineLen;
    while(list.hasNext()) {
      line=list.next();
      lineLen=metrics.stringWidth(line);
      if(lineLen>with) {
        reorganize(sb,list,new StringBuffer(line));
        break;
      }
View Full Code Here

      item=list.next();
      rest.append(list.delimiter());
      rest.append(item);
    }
   
    StringList words = ListUtil.toWordList(rest.toString());
    StringBuffer line=new StringBuffer();
   
    while(words.hasNext()) {
      item=words.next();
     
      if(line.length()>0 && metrics.stringWidth(item.concat(" ").concat(line.toString()))>with) {
        if(sb.length()>0) sb.append('\n');
        sb.append(line);
        //print.out("line:"+line);
        line=new StringBuffer(item);
      }
      else {
        //item=words.next();
        if(line.length()>0)line.append(words.delimiter()==0?' ':words.delimiter());
        line.append(item);
      }
    }
    if(line.length()>0){
      if(sb.length()>0) sb.append('\n');
View Full Code Here

TOP

Related Classes of railo.commons.lang.StringList$Entry

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.