public Integer[] getSelected() {
        ArrayList<Integer> selectedIndex = new ArrayList<Integer>();
        for(int i = 0; i < selected.size(); ++i) {
            if(selected.get(i)) {
                selectedIndex.add(i);
            }
        }
        return (Integer[]) selectedIndex.toArray();
    }