Package railo.runtime.type

Examples of railo.runtime.type.ArrayImpl


   
    if(s<1) throw new FunctionException(pc, "ArrayMid", 2, "start", "Parameter which is now ["+s+"] must be a positive integer");
    if(c==-1) c=arr.size();
    else if(c<-1) throw new FunctionException(pc, "ArrayMid", 3, "count", "Parameter which is now ["+c+"] must be a non-negative integer or -1 (for string length)");
    c+=s-1;
    if(s>arr.size()) return new ArrayImpl();
   
    ArrayImpl rtn = new ArrayImpl();
    int len = arr.size();
    Object value;
    for(int i=s;i<=c && i<=len ;i++){
      value=arr.get(i, null);
      rtn.appendEL(value);
    }
    return rtn;
  }
View Full Code Here


    FunctionArgument[] args = filter.getFunctionArguments();
    if(args.length>1)
      throw new ExpressionException("UDF filter has too many arguments ["+args.length+"], should have at maximum 1 argument");
   
   
    Array rtn=new ArrayImpl();
    Iterator<Object> it = array.valueIterator();
    Object value;
    while(it.hasNext()){
      value=it.next();
      if(Caster.toBooleanValue(filter.call(pc, new Object[]{value}, true)))
        rtn.append(value);
    }
    return rtn;
  }
View Full Code Here

public final class ArrayReverse extends BIF {

  private static final long serialVersionUID = 5418304787535992180L;

  public static Array call(PageContext pc , Array array) throws ExpressionException {
    Array rev=new ArrayImpl(array.getDimension());
    int len=array.size();
    for(int i=0;i<len;i++) {
      try {
        rev.setE(len-i,array.getE(i+1));
      } catch (PageException e) {
      }
    }
    return rev;
 
View Full Code Here

    Array array;
    if(o instanceof String){
      array=ListUtil.listToArrayRemoveEmpty(Caster.toString(o),',');
    }
    else if(o instanceof Struct){
      array=new ArrayImpl();
      Struct sct=(Struct) o;
      Iterator<Object> it = sct.valueIterator();
      while(it.hasNext()) {
        array.append(it.next());
      }
View Full Code Here

   */
  public static String translateScriptProtect(int scriptProtect) {
    if(scriptProtect==ApplicationContext.SCRIPT_PROTECT_NONE) return "none";
    if(scriptProtect==ApplicationContext.SCRIPT_PROTECT_ALL) return "all";
   
    Array arr=new ArrayImpl();
    if((scriptProtect&ApplicationContext.SCRIPT_PROTECT_CGI)>0) arr.appendEL("cgi");
    if((scriptProtect&ApplicationContext.SCRIPT_PROTECT_COOKIE)>0) arr.appendEL("cookie");
    if((scriptProtect&ApplicationContext.SCRIPT_PROTECT_FORM)>0) arr.appendEL("form");
    if((scriptProtect&ApplicationContext.SCRIPT_PROTECT_URL)>0) arr.appendEL("url");
   
   
   
    try {
      return ListUtil.arrayToList(arr, ",");
View Full Code Here

public final class ArrayNew extends BIF {

  private static final long serialVersionUID = -5923269433550568279L;

  public static Array call(PageContext pc) throws ExpressionException  {
    return new ArrayImpl(1);
  }
View Full Code Here

  public static Array call(PageContext pc) throws ExpressionException  {
    return new ArrayImpl(1);
  }
 
  public static Array call(PageContext pc , double number) throws ExpressionException {
    return new ArrayImpl((int)number);
  }
View Full Code Here

        else if(type==SearchIndex.TYPE_CUSTOM) {
          Query qv;
          if(StringUtil.isEmpty(query)){
           
          // set columns
            railo.runtime.type.Array columns=new ArrayImpl();
              columns.append("key");
              columns.append("body");
              if(!StringUtil.isEmpty(title))columns.append("title");
              if(!StringUtil.isEmpty(urlpath))columns.append("urlpath");
              if(!StringUtil.isEmpty(custom1))columns.append("custom1");
              if(!StringUtil.isEmpty(custom2))columns.append("custom2");
              if(!StringUtil.isEmpty(custom3))columns.append("custom3");
              if(!StringUtil.isEmpty(custom4))columns.append("custom4");
             
            // populate query with a single row
                qv=new QueryImpl(columns,1,"query");
                // body
                qv.setAt(KeyConstants._key, 1, key);
View Full Code Here

      if(Util.isEmpty(filter)) keys=cache.keys();
      else keys=cache.keys(new WildCardFilter(filter,false));
      return Caster.toArray(keys);
    }
    catch (Exception e) {}
    return new ArrayImpl();
  }
View Full Code Here

   */
  public static Array call(PageContext pc , Object[] objArr) {
    for(int i=0;i<objArr.length;i++) {
      if(objArr[i] instanceof FunctionValue)objArr[i]=((FunctionValue)objArr[i]).getValue();
    }
    return new ArrayImpl(objArr);
  }
View Full Code Here

TOP

Related Classes of railo.runtime.type.ArrayImpl

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.