-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDerivedUnit.java
More file actions
104 lines (87 loc) · 1.88 KB
/
DerivedUnit.java
File metadata and controls
104 lines (87 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package com.dz_fs_dev.physics;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
/**
* Contains all International System of Units constants and definitions.
*
* @author DZ-FSDev
* @since 17.0.1
* @version 0.0.7
*/
public abstract class DerivedUnit implements IUnit{
/**
* @since 0.0.7
*/
static final class Newton extends DerivedUnit implements IPowable<Newton>{
public Newton() {
super(new SIUnit[] {new SIUnit.Meter(1), new SIUnit.Gram(1),
new SIUnit.Second(-2)});
}
@Override
public String symbol() {
return "N";
}
@Override
public String name() {
return "Newton";
}
@Override
public Newton pow(int exponent) {
// TODO Auto-generated method stub
return null;
}
@Override
public Newton pow(Rational exponent) {
// TODO Auto-generated method stub
return null;
}
}
/**
* @since 0.0.7
*/
static final class Volt extends DerivedUnit implements IPowable<Volt> {
public Volt() {
super(new SIUnit[] {new SIUnit.Gram(3), new SIUnit.Meter(1),
new SIUnit.Ampere(-1), new SIUnit.Second(-3)});
}
@Override
public String symbol() {
return "V";
}
@Override
public String name() {
return "Volt";
}
@Override
public Volt pow(int exponent) {
// TODO Auto-generated method stub
return null;
}
@Override
public Volt pow(Rational exponent) {
// TODO Auto-generated method stub
return null;
}
}
private @Getter(AccessLevel.PRIVATE) @Setter(AccessLevel.PRIVATE) SIUnit[] constituents;
private final int order;
private DerivedUnit(SIUnit[] constituents) {
this.setConstituents(constituents);
order = 1;
}
@Override
public int getOrder() {
return this.order;
}
@Override
public IUnit divideBy(IUnit o) {
// TODO Auto-generated method stub
return null;
}
@Override
public IUnit multiplyBy(IUnit o) {
// TODO Auto-generated method stub
return null;
}
}