Enum FileInfoBase.Unit

    • Field Detail

      • legacyNum

        private int legacyNum
      • str

        private java.lang.String str
      • abbrev

        private java.lang.String abbrev
      • convFactor

        private double convFactor
    • Constructor Detail

      • Unit

        private Unit​(int legacyNum,
                     java.lang.String str,
                     java.lang.String abbrev,
                     FileInfoBase.UnitType type)
      • Unit

        private Unit​(int legacyNum,
                     java.lang.String str,
                     java.lang.String abbrev,
                     FileInfoBase.UnitType type,
                     double convFactor)
    • Method Detail

      • values

        public static FileInfoBase.Unit[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FileInfoBase.Unit c : FileInfoBase.Unit.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FileInfoBase.Unit valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<FileInfoBase.Unit>
      • getAbbrev

        public java.lang.String getAbbrev()
      • getConvFactor

        public double getConvFactor()
      • getLegacyNum

        public int getLegacyNum()
      • convertTo

        public double convertTo​(double origValue,
                                FileInfoBase.Unit resultUnit)
        Method converts the origValue quantity from the current units to the resultUnit.
        Parameters:
        origValue - A value in units of this
        resultUnit - The units to convert to
        Returns:
        The converted quantity
      • convertFrom

        public double convertFrom​(double origValue,
                                  FileInfoBase.Unit origUnit)
        Method converts the origValue that is currently in units of origUnit to the units specified by this unit.
        Parameters:
        origValue - A value in units of origUnit
        origUnit - The current units of the quantity specified
        Returns:
        The quantity converted into the current units
      • getConversionFactor

        public double getConversionFactor​(FileInfoBase.Unit resultUnit)
      • getUnitFromAbbrev

        public static FileInfoBase.Unit getUnitFromAbbrev​(java.lang.String abbrev)
      • getUnitFromLegacyNum

        public static FileInfoBase.Unit getUnitFromLegacyNum​(int legacyNum)