package kfs.kfsDbi;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 *
 * @author pavedrim
 */
public class kfsPojoArrayList<B extends kfsDbObject, T extends kfsPojoObj<B>> implements kfsADb.loadCB, Collection<T> {

    @Override
    public int size() {
        return lst.size();
    }

    @Override
    public boolean isEmpty() {
        return lst.isEmpty();
    }

    @Override
    public boolean contains(Object o) {
        return lst.contains(o);
    }

    @Override
    public Object[] toArray() {
        return lst.toArray();
    }

    @Override
    public <T> T[] toArray(T[] a) {
        return lst.toArray(a);
    }

    @Override
    public boolean remove(Object o) {
        return lst.remove(o);
    }

    @Override
    public boolean containsAll(Collection<?> c) {
        return lst.containsAll(c);
    }

    @Override
    public boolean addAll(Collection<? extends T> c) {
       return lst.addAll(c);
    }

    @Override
    public boolean removeAll(Collection<?> c) {
        return lst.removeAll(c);
    }

    @Override
    public boolean retainAll(Collection<?> c) {
        return lst.removeAll(c);
    }

    @Override
    public void clear() {
        lst.clear();
    }

    
    private final B base;

    public kfsPojoArrayList(B base) {
        this.base = base;
    }
    private final ArrayList<T> lst = new ArrayList<T>();

    /**
     *
     * @param rd
     * @return
     */
    @Override
    public boolean add(T rd) {
        return lst.add(rd);
    }

    @Override
    public boolean kfsDbAddItem(kfsRowData rd) {
        add((T) base.getPojo(rd));
        return true;
    }

    @Override
    public Iterator<T> iterator() {
        return lst.iterator();
    }

}

@@ -71,16 +71,75 @@
 ection;%0A
+import java.util.Collections;%0Aimport java.util.Comparator;%0A
 import j
@@ -1296,24 +1296,119 @@
 r();%0A    %7D%0A%0A
+    protected void sort(Comparator%3C? super T%3E cmp) %7B%0A        Collections.sort(lst, cmp);%0A    %7D%0A
     %0A    pri

Add Sort to pojo list