public < T extends Widget & Checkable > List < Integer > getCheckedWidgetIndexes ( ) { List < Integer > checked = new ArrayList <> ( ) ; List < Widget > children = getChildren ( ) ; final int size = children . size ( ) ; for ( int i = 0 , j = - 1 ; i < size ; ++ i ) { Widget c = children . get ( i ) ; if ( c instanceof Checkable ) { ++ j ; if ( ( ( Checkable ) c ) . isChecked ( ) ) { checked . add ( j ) ; } } } return checked ; }
Gets all checked widget indexes in the group . The indexes are counted from 0 to size - 1 where size is the number of Checkable widgets in the group . It does not take into account any non - Checkable widgets added to the group widget .