Class Length


  • public class Length
    extends java.lang.Object
    An instance of this class represents a certain length value. Different methods allow to retrieve it in various units.
    • Constructor Summary

      Constructors 
      Constructor Description
      Length​(double length_m)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double get_ft()
      Return length in feet.
      double get_m()
      Return length in meters.
      static double meter_to_feet​(double length_m)
      Static method to convert meters to feet.
      void set_ft​(double length_ft)
      Set length in feet.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Length

        public Length​(double length_m)
        Constructor.
        Parameters:
        length_m - length in meters
    • Method Detail

      • set_ft

        public void set_ft​(double length_ft)
        Set length in feet.
        Parameters:
        length_ft - length in feet
      • get_m

        public double get_m()
        Return length in meters.
        Returns:
        length in meters
      • get_ft

        public double get_ft()
        Return length in feet.
        Returns:
        length in feet
      • meter_to_feet

        public static double meter_to_feet​(double length_m)
        Static method to convert meters to feet.
        Parameters:
        length_m - length in meters
        Returns:
        length in feet