001 /** 002 * Implements the Cold Fusion Function arrayMerge 003 * Merge 2 arrays 004 */ 005 package railo.runtime.functions.arrays; 006 007 import railo.runtime.PageContext; 008 import railo.runtime.exp.ExpressionException; 009 import railo.runtime.exp.PageException; 010 import railo.runtime.ext.function.Function; 011 import railo.runtime.type.Array; 012 import railo.runtime.type.ArrayImpl; 013 014 015 public final class ArrayReverse implements Function { 016 public static Array call(PageContext pc , Array array) throws ExpressionException { 017 Array rev=new ArrayImpl(array.getDimension()); 018 int len=array.size(); 019 for(int i=0;i<len;i++) { 020 try { 021 rev.setE(len-i,array.getE(i+1)); 022 } catch (PageException e) { 023 } 024 } 025 return rev; 026 } 027 }