-
Notifications
You must be signed in to change notification settings - Fork 0
/
Connector.java
36 lines (31 loc) · 928 Bytes
/
Connector.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
public class Connector { //Connector object
//Instance Variables
private String ctype;
private String ucode; //unicode for character
//constructor
Connector(String ctype) {
//ctype in form AND, OR, IF, or IFF
this.ctype = ctype;
//determine character unicode
switch(ctype) {
case "AND":
this.ucode = "\u2227"; //"∧"
break;
case "OR":
this.ucode = "\u2228"; //"∨"
break;
case "IF":
this.ucode = "\u2192"; //"→"
break;
case "IFF":
this.ucode = "\u2194"; //"↔"
break;
}
}
String getCtype() {
return ctype;
} //return type of connector
public String toString() {
return ucode;
} //convert connector to string
}