forked from angelsl/Wabbitemu-Android
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCalcModel.java
More file actions
37 lines (30 loc) · 986 Bytes
/
Copy pathCalcModel.java
File metadata and controls
37 lines (30 loc) · 986 Bytes
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
package io.github.angelsl.wabbitemu.calc;
public enum CalcModel {
NO_CALC(CalcInterface.NO_CALC),
TI_81(CalcInterface.TI_81),
TI_82(CalcInterface.TI_82),
TI_83(CalcInterface.TI_83),
TI_85(CalcInterface.TI_85),
TI_86(CalcInterface.TI_86),
TI_73(CalcInterface.TI_73),
TI_83P(CalcInterface.TI_83P),
TI_83PSE(CalcInterface.TI_83PSE),
TI_84P(CalcInterface.TI_84P),
TI_84PSE(CalcInterface.TI_84PSE),
TI_84PCSE(CalcInterface.TI_84PCSE);
private final int mCalcInterfaceModel;
CalcModel(int calcInterfaceModel) {
mCalcInterfaceModel = calcInterfaceModel;
}
public static CalcModel fromModel(int model) {
for (CalcModel calcModel : values()) {
if (calcModel.mCalcInterfaceModel == model) {
return calcModel;
}
}
throw new IllegalStateException("Invalid model " + model);
}
public int getModelInt() {
return mCalcInterfaceModel;
}
}