uebung07
This commit is contained in:
19
uebung07/src/quantities/generic/LengthUnit.java
Normal file
19
uebung07/src/quantities/generic/LengthUnit.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package quantities.generic;
|
||||
|
||||
public class LengthUnit extends Unit<Length> {
|
||||
public LengthUnit(String name, double baseFactor) {
|
||||
super(name, baseFactor);
|
||||
}
|
||||
|
||||
public static final LengthUnit METER = new LengthUnit("m", 1);
|
||||
public static final LengthUnit MILLIMETER = new LengthUnit("mm", 0.001);
|
||||
public static final LengthUnit KILOMETER = new LengthUnit("km", 1000);
|
||||
public static final LengthUnit MILE = new LengthUnit("mi", 1609.344);
|
||||
public static final LengthUnit LIGHTYEAR = new LengthUnit("ly", 9460730472580800.0);
|
||||
public static final LengthUnit PARSEC = new LengthUnit("pc", 3.0856776e16);
|
||||
|
||||
@Override
|
||||
public Length quantity(double value) {
|
||||
return new Length(value, this);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user