Package ucar.units

Class PrefixSymbol

  • All Implemented Interfaces:
    Comparable<Object>

    @Immutable
    public final class PrefixSymbol
    extends Prefix
    Provides support for prefix symbols. Instances of this class are immutable.
    • Constructor Detail

      • PrefixSymbol

        public PrefixSymbol​(String name,
                            double value)
        Constructs from a name and a numeric value.
        Parameters:
        name - The name for the prefix.
        value - The numeric value for the prefix.
    • Method Detail

      • compareTo

        public final int compareTo​(Object obj)
        Compares this prefix against another PrefixSymbol. The sort keys are decreasing length (major) and increasing lexicality (minor).
        Specified by:
        compareTo in interface Comparable<Object>
        Specified by:
        compareTo in class Prefix
        Parameters:
        obj - The other PrefixSymbol.
        Returns:
        A negative value, zero, or a positive value depending on whether this PrefixSymbol is less than, equal to, or greater than obj, respectively.
      • compareTo

        public final int compareTo​(String string)
        Compares this prefix against a String. The sort keys are decreasing length (major) and increasing lexicality (minor).
        Specified by:
        compareTo in class Prefix
        Parameters:
        string - The string.
        Returns:
        A negative value, zero, or a positive value depending on whether this PrefixSymbol is less than, equal to, or greater than string, respectively.