Class AbstractSystemOfUnits.Helper

    • Constructor Detail

    • Method Detail

      • addUnit

        public static <U extends Unit<?>> U addUnit​(Set<Unit<?>> units,
                                                    U unit,
                                                    String name)
        Adds a new named unit to a collection.
        Parameters:
        units - the collection to add to.
        unit - the unit being added.
        name - the name of the unit.
        Returns:
        unit.
        Since:
        1.0
      • addUnit

        public static <U extends Unit<?>> U addUnit​(Set<Unit<?>> units,
                                                    U unit,
                                                    String name,
                                                    String symbol)
        Adds a new named unit to a collection.
        Parameters:
        units - the collection to add to.
        unit - the unit being added.
        name - the name of the unit.
        symbol - the symbol of the unit.
        Returns:
        unit.
        Since:
        1.0
      • addUnit

        public static <U extends Unit<?>> U addUnit​(Set<Unit<?>> units,
                                                    U unit,
                                                    String name,
                                                    String symbol,
                                                    UnitStyle style)
        Adds a new named unit to a set.
        Parameters:
        units - the set to add to.
        unit - the unit being added.
        name - the name of the unit.
        symbol - the symbol of the unit.
        style - style of the unit.
        Returns:
        unit.
        Since:
        1.0.1
      • addUnit

        public static <U extends Unit<?>> U addUnit​(Set<Unit<?>> units,
                                                    U unit,
                                                    String text,
                                                    UnitStyle style)
        Adds a new labeled unit to a set.
        Parameters:
        units - the set to add to.
        unit - the unit being added.
        text - the text for the unit.
        style - style of the unit.
        Returns:
        unit.
        Since:
        1.0.1