001/**
002 * Unit-API - Units of Measurement API for Java
003 * Copyright (c) 2014 Jean-Marie Dautelle, Werner Keil, V2COM
004 * All rights reserved.
005 *
006 * See LICENSE.txt for details.
007 */
008package javax.measure.spi;
009
010import javax.measure.format.UnitFormat;
011
012/**
013 * <p>
014 * This interface represent the service to obtain {@link UnitFormat} instances.
015 * </p>
016 * 
017 * @author <a href="mailto:[email protected]">Jean-Marie Dautelle</a>
018 * @author <a href="mailto:[email protected]">Werner Keil</a>
019 * @version 0.5, $Date: 2014-12-01 $
020 */
021public interface UnitFormatService {
022
023    /**
024     * Returns the default unit format.
025     * 
026     * It is up to implementations what to consider a suitable default.
027     * For some implementations it may be a unit format based on <code>Locale.getDefault()</code> while others may return <code>getUnitFormat("UCUM")</code>
028     *
029     * @return the default {@link UnitFormat} implementation.
030     */
031        UnitFormat getUnitFormat();
032
033    /**
034     * Returns the unit format having the specified name or
035     * <code>null</code> if none.
036     * 
037     * For example <code>getUnitFormat("UCUM")</code> to return a UCUM specific {@link UnitFormat} implementation. 
038     *
039     * @param name the name of the format.
040     * @return the corresponding unit format.
041     */
042        UnitFormat getUnitFormat(String name);
043}