Interface UnitEnumHasShortUnit<T>

All Superinterfaces:
UnitEnum<T>
All Known Implementing Classes:
DistanceUnit

public interface UnitEnumHasShortUnit<T> extends UnitEnum<T>
This interface specifies a Enum for units that has a smaller version of the unit in the same system of units (standard/imperial vs. metric).
Author:
Andrew Pavlin, KA2DDO
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get depth index for this unit instance's hierarchy of different-sized units.
    <T extends UnitEnumHasShortUnit<T>>
    T
    Get the shorter unit associated with this unit.

    Methods inherited from interface org.ka2ddo.util.UnitEnum

    from, getOffset
  • Method Details

    • getShortUnit

      <T extends UnitEnumHasShortUnit<T>> T getShortUnit()
      Get the shorter unit associated with this unit.
      Type Parameters:
      T - Enum subclass implementing this interface
      Returns:
      shorter unit in same system of measurement
    • getDepth

      int getDepth()
      Get depth index for this unit instance's hierarchy of different-sized units.
      Returns:
      zero-based index of how many times you can get a shorter unit before you reach the smallest unit