private ImageFormat getFormat(List<ImageFormat> l, String n){
		for(ImageFormat f:l)
			if(f.getName().equals(n))
				return f;
		return null;
	}
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
@param l the image format list
@param n the name of the format
@return the image format with the given name, or null