public CurrencyUnit getCurrency ( CurrencyQuery query ) { Set < CurrencyUnit > currencies = getCurrencies ( query ) ; if ( currencies . isEmpty ( ) ) { return null ; } if ( currencies . size ( ) == 1 ) { return currencies . iterator ( ) . next ( ) ; } throw new MonetaryException ( "Ambiguous request for CurrencyUnit: " + query + ", found: " + currencies ) ; }
Access a single currency by query .