private ImageFormat getFormat ( List < ImageFormat > l , String n ) { for ( ImageFormat f : l ) if ( f . getName ( ) . equals ( n ) ) return f ; return null ; }
this method returns a format in a list given its name