uebung07
This commit is contained in:
17
uebung07/src/quantities/generic/TimeUnit.java
Normal file
17
uebung07/src/quantities/generic/TimeUnit.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package quantities.generic;
|
||||
|
||||
public class TimeUnit extends Unit<Time> {
|
||||
public TimeUnit(String name, double baseFactor) {
|
||||
super(name, baseFactor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Time quantity(double value) {
|
||||
return new Time(value, this);
|
||||
}
|
||||
|
||||
public static final TimeUnit SECOND = new TimeUnit("s", 1);
|
||||
public static final TimeUnit MINUTE = new TimeUnit("min", 60);
|
||||
public static final TimeUnit HOUR = new TimeUnit("h", 3600);
|
||||
public static final TimeUnit DAY = new TimeUnit("d", 86400);
|
||||
}
|
||||
Reference in New Issue
Block a user