Package ucar.units

Class Prefix

    • Constructor Detail

      • Prefix

        protected Prefix​(String id,
                         double value)
        Constructs from an identifier and a value.
        Parameters:
        id - The prefix identifier (e.g. "milli" or "m").
        value - The prefix value (e.g. 1e-3).
    • Method Detail

      • getID

        public final String getID()
        Gets the prefix identifier.
        Returns:
        The prefix identifier.
      • toString

        public final String toString()
        Returns the string representation of this prefix.
        Overrides:
        toString in class Object
        Returns:
        The string representation of this prefix.
      • getValue

        public final double getValue()
        Gets the prefix value.
        Returns:
        The prefix value.
      • compareTo

        public abstract int compareTo​(Object obj)
        Compares this prefix to another.
        Specified by:
        compareTo in interface Comparable<Object>
        Parameters:
        obj - The other prefix.
        Returns:
        A negative value, zero, or a positive value depending on whether this prefix is less than equal to, or greater than obj.
      • compareTo

        public abstract int compareTo​(String string)
        Compares this prefix to a string.
        Parameters:
        string - The string.
        Returns:
        A negative value, zero, or a positive value depending on whether this prefix is less than equal to, or greater than the string.
      • length

        public final int length()
        Return the length of the prefix identifier.
        Returns:
        The length of the prefix identifier.