2

I have a list of entities where i have to sort them based on their amount, i am trying to iterate the list and get the amount from the entity object and want to create an array to sort it in MVEL. i am stuck in array creation.

here is my code for array creation

def array(listA,size) {
    Object array[] = new Object[size];
    count = 0;
    for(entity:listA){
        array[count] = entity.amount;
        count = count + 1;      
    }
    System.out.println("array = "+ array);
    sortedArray = quicksort(array); 
};

Can anyone tell me how to create ARRAYS in MVEL language.

Thank You.

4

0 回答 0