use of org.openlca.core.model.descriptors.CurrencyDescriptor in project olca-modules by GreenDelta.
the class CurrencyDao method getReferenceCurrency.
/**
* There should be only one currency that is the reference currency in the
* database. This function returns the reference currency of the first
* currency in the database (which should by the reference currency of all
* other currencies by this definition). If there is no currency contained
* in the database, this function will return null.
*/
public Currency getReferenceCurrency() {
List<CurrencyDescriptor> all = getDescriptors();
if (all.isEmpty())
return null;
Currency currency = getForId(all.get(0).id);
return currency == null ? null : currency.referenceCurrency;
}
Aggregations