private ImageFormat getFormat ( List < ImageFormat > l , int i ) { for ( ImageFormat f : l ) if ( f . getIndex ( ) == i ) return f ; return null ; }
this method returns a format in a list given its index