Feet class final
Sadly a still commonly used Unit
of Length
discovered in US "football"
https://en.wikipedia.org/wiki/Foot_(unit)
- Inheritance
-
- Object
- FundamentalLength<
Foot> - Feet
- Implemented types
-
- Comparable<
PhysicalQuantities< T> >
- Comparable<
Constructors
- Feet(Measurement m)
-
Immutable.
Unit
is Foot.const -
Feet.from(PhysicalQuantities<
Length> l) -
toUnit support.
factory
- Feet.fromChains(Chains c)
-
1 chain = 66 ft.
factory
- Feet.fromFurlongs(Furlongs f)
-
1 fur = 10 chains = 660 ft.
factory
- Feet.fromHands(Hands h)
-
1 ft = 3 hh.
factory
- Feet.fromInches(Inches i)
-
1 ft = 12 in.
factory
- Feet.fromLeagues(Leagues l)
-
1 lea = 3 mi = 15480 ft.
factory
- Feet.fromMiles(Miles m)
-
1 mi = 5280 ft. We had to memorize this in high school chemisty. :/
factory
- Feet.fromNum(num n)
-
Crude
measurement.factory - Feet.fromYards(Yards y)
-
1 yd = 3 ft.
factory
Properties
Methods
-
baseUnit(
Measurement q) → PhysicalQuantities< Length> -
inherited
-
compareTo(
PhysicalQuantities< Length> other) → int -
Compares this object to another object.
inherited
-
fundamental(
) → Measurement -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
It may seem strange to only define (+,-) without (*,/)...
but conceptually things get tricky.
2 kg * 4 kg = 8 kg^2.
2 kg / 4 kg = 0.5 (no unit)
These results are computational devices.
They are not "masses." What is the return type?
kg^2 is used within the context of gravitational attraction, but only
as a factor for calculations-- it doesn't have much conceptual meaning.
Multiplication might result in a single unit raised to a power or u1 * u2
Division might result in only a
NumericalValue
or u1 / u2. That complexity would make the API difficult to understand; although rigourously correct. This is all very interesting and discussed in: https://en.wikipedia.org/wiki/Unit_of_measurement#Units_as_dimensions and https://en.wikipedia.org/wiki/Quantity_calculus I'm not a physicist and I don't need it, so, punting. :Pinherited -
toUnit(
Length u) → PhysicalQuantities< Length> -
inherited
Operators
-
operator +(
PhysicalQuantities< Length> o) → PhysicalQuantities<Length> -
inherited
-
operator -(
PhysicalQuantities< Length> o) → PhysicalQuantities<Length> -
inherited
-
operator <(
PhysicalQuantities< Length> o) → bool -
inherited
-
operator <=(
PhysicalQuantities< Length> o) → bool -
inherited
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator >(
PhysicalQuantities< Length> o) → bool -
inherited
-
operator >=(
PhysicalQuantities< Length> o) → bool -
inherited