Package railo.runtime.type

Examples of railo.runtime.type.Array


    }
    return tarr;
  }
 
  public static Object[] toNullArray(Object obj) throws PageException {
    Array arr = Caster.toArray(obj);
    Object[] tarr=new Object[arr.size()];
    for(int i=0;i<tarr.length;i++) {
      tarr[i]=Caster.toNull(arr.getE(i+1));
    }
    return tarr;
  }
View Full Code Here


  }
 
  public static long[] toLongArray(Object obj) throws PageException {
    if(obj instanceof long[]) return (long[]) obj;
   
    Array arr = Caster.toArray(obj);
    long[] tarr=new long[arr.size()];
    for(int i=0;i<tarr.length;i++) {
      tarr[i]=Caster.toLongValue(arr.getE(i+1));
    }
    return tarr;
  }
View Full Code Here

  }

  public static float[] toFloatArray(Object obj) throws PageException {
    if(obj instanceof float[]) return (float[]) obj;
   
    Array arr = Caster.toArray(obj);
    float[] tarr=new float[arr.size()];
    for(int i=0;i<tarr.length;i++) {
      tarr[i]=Caster.toFloatValue(arr.getE(i+1));
    }
    return tarr;
  }
View Full Code Here

  }
 
  public static double[] toDoubleArray(Object obj) throws PageException {
    if(obj instanceof double[]) return (double[]) obj;
   
    Array arr = Caster.toArray(obj);
    double[] tarr=new double[arr.size()];
    for(int i=0;i<tarr.length;i++) {
      tarr[i]=Caster.toDoubleValue(arr.getE(i+1));
    }
    return tarr;
  }
View Full Code Here

  }
 
  public static char[] toCharArray(Object obj) throws PageException {
    if(obj instanceof char[]) return (char[]) obj;
   
    Array arr = Caster.toArray(obj);
    char[] tarr=new char[arr.size()];
    for(int i=0;i<tarr.length;i++) {
      tarr[i]=Caster.toCharValue(arr.getE(i+1));
    }
    return tarr;
  }
View Full Code Here

      if(item!=null)return item;
    }
   
    // form . x
    try {
      Array array = ListUtil.listToArray(lcKey, '.');
      if(array.size()>1 && array.getE(1).toString().trim().equals("form")) {
        array.removeE(1);
        lcKey=ListUtil.arrayToList(array, ".").trim();
        item = fileItems.get(lcKey);
        if(item!=null)return item;
      }
    }
View Full Code Here

        }
        return setId(id,table);
      }
      // Object[]
      if(Decision.isNativeArray(o)) {
        Array arr;
        try {
          arr = Caster.toArray(o);
          DumpTable htmlBox = new DumpTable("array","#ff9900","#ffcc00","#000000");
          htmlBox.setTitle("Native Array ("+Caster.toClassName(o)+")");
       
          int length=arr.size();
       
          for(int i=1;i<=length;i++) {
            Object ox=null;
            try {
              ox = arr.getE(i);
            } catch (Exception e) {}
            htmlBox.appendRow(1,new SimpleDumpData(i),toDumpData(ox,pageContext,maxlevel,props));
          }
          return setId(id,htmlBox);
        }
View Full Code Here

    //responseHeader
      railo.commons.net.http.Header[] headers = rsp.getAllHeaders();
      StringBuffer raw=new StringBuffer(rsp.getStatusLine()+" ");
      Struct responseHeader = new StructImpl();
      Struct cookie;
      Array setCookie = new ArrayImpl();
      Query cookies=new QueryImpl(new String[]{"name","value","path","domain","expires","secure","httpOnly"},0,"cookies");
     
          for(int i=0;i<headers.length;i++) {
            railo.commons.net.http.Header header=headers[i];
            //print.ln(header);
           
            raw.append(header.toString()+" ");
            if(header.getName().equalsIgnoreCase("Set-Cookie")) {
              setCookie.append(header.getValue());
              parseCookie(cookies,header.getValue());
            }
            else {
                //print.ln(header.getName()+"-"+header.getValue());
              Object value=responseHeader.get(KeyImpl.getInstance(header.getName()),null);
              if(value==null) responseHeader.set(KeyImpl.getInstance(header.getName()),header.getValue());
              else {
                  Array arr=null;
                  if(value instanceof Array) {
                      arr=(Array) value;
                  }
                  else {
                      arr=new ArrayImpl();
                      responseHeader.set(KeyImpl.getInstance(header.getName()),arr);
                      arr.appendEL(value);
                  }
                  arr.appendEL(header.getValue());
              }
            }
           
            // Content-Type
            if(header.getName().equalsIgnoreCase("Content-Type")) {
View Full Code Here

     */
    public void setRange(String range) throws PageException {
        String errMessage="attribute range has an invalid value ["+range+"], must be string list with numbers";
        String errDetail="Example: [number_from,number_to], [number_from], [number_from,], [,number_to]";
       
        Array arr=ListUtil.listToArray(range,',');
       
        if(arr.size()==1) {
            double from=Caster.toDoubleValue(arr.get(1,null),Double.NaN);
            if(!Decision.isValid(from))throw new ApplicationException(errMessage,errDetail);
            input.setRangeMin(from);
            input.setRangeMax(Double.NaN);
            if(from<100)params.setEL("minimum",Caster.toString(from));
        }
        else if(arr.size()==2) {
            String strFrom=arr.get(1,"").toString().trim();
            double from=Caster.toDoubleValue(strFrom,Double.NaN);
            if(!Decision.isValid(from) && strFrom.length()>0) {
                throw new ApplicationException(errMessage,errDetail);
            }
            input.setRangeMin(from);
           
            String strTo=arr.get(2,"").toString().trim();
            double to=Caster.toDoubleValue(strTo,Double.NaN);
            if(!Decision.isValid(to) && strTo.length()>0) {
                throw new ApplicationException(errMessage,errDetail);
            }
            input.setRangeMax(to);
View Full Code Here

    setRetryinterval(obj);
  }
 
  public void setRetryinterval(Object obj) throws PageException {
    if(StringUtil.isEmpty(obj))return;
    Array arr = Caster.toArray(obj,null);
    if(arr==null){
      plans=new ExecutionPlan[]{toExecutionPlan(obj,1)};
    }
    else {
      Iterator<Object> it = arr.valueIterator();
      plans=new ExecutionPlan[arr.size()];
      int index=0;
      while(it.hasNext()) {
        plans[index++]=toExecutionPlan(it.next(),index==1?1:0);
      }
    }
View Full Code Here

TOP

Related Classes of railo.runtime.type.Array

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.