Class UnitsCache


  • public class UnitsCache
    extends Object
    Cache for parsed units.
    Since:
    11.0
    Author:
    Luc Maisonobe
    • Constructor Detail

      • UnitsCache

        public UnitsCache()
        Simple constructor.
    • Method Detail

      • getUnits

        public Unit getUnits​(String specification)
        Get units from a string specification.

        Parsing is performed only the first time a specification is encountered, so the cache speeds up cases where the same units is encountered many times (for example when parsing CCSDS messages with many entries).

        Parameters:
        specification - units specification (may be null)
        Returns:
        parsed units (Unit.NONE if specification is null)