-
Notifications
You must be signed in to change notification settings - Fork 0
/
GeneralCalButton.java
41 lines (34 loc) · 980 Bytes
/
GeneralCalButton.java
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package calql8r;
import calql8r.Enums.EnumError;
import calql8r.Values.CalAns;
/**
*
* @author MARTIN
*/
abstract public class GeneralCalButton {
public static final int FUNCTION = 1;
public static final int OPERATOR = 2;
public static final int EXTRA_OPERATOR = 3;
public static final int LOGIC = 4;
public static final int VALUES = 5;
abstract public String displayText();
@Override
public String toString() {
return displayText();
}
protected CalAns mathError() {
CalAns a = new CalAns(0);
a.setError(EnumError.MATH);
return a;
}
protected CalAns syntaxError() {
CalAns a = new CalAns(0);
a.setError(EnumError.SYNTAX);
return a;
}
}