Skip to content

Commit f45494a

Browse files
author
Dr. Brandon Wiley
committed
Converted symbol implementations to new interface
1 parent 55c619d commit f45494a

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

Codex/src/main/java/org/operatorfoundation/codex/symbols/CallAny.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CallAny {
88
return "CallAny"
99
}
1010

11-
fun decode(n: String): Int {
11+
fun decode(n: ByteArray): Int {
1212
return when (n) {
1313
"A" -> 0
1414
"B" -> 1
@@ -51,7 +51,7 @@ class CallAny {
5151
}
5252
}
5353

54-
fun encode(n: Int): String {
54+
fun encode(n: Int): ByteArray {
5555
return when (n) {
5656
0 -> "A"
5757
1 -> "B"

Codex/src/main/java/org/operatorfoundation/codex/symbols/CallLetter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CallLetter {
88
return "CallLetter"
99
}
1010

11-
fun decode(n: String): Int {
11+
fun decode(n: ByteArray): Int {
1212
return when (n) {
1313
"A" -> 0
1414
"B" -> 1
@@ -40,7 +40,7 @@ class CallLetter {
4040
}
4141
}
4242

43-
fun encode(n: Int): String {
43+
fun encode(n: Int): ByteArray {
4444
return when (n) {
4545
0 -> "A"
4646
1 -> "B"

Codex/src/main/java/org/operatorfoundation/codex/symbols/CallLetterNumber.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CallLetterNumber {
88
return "CallLetterNumber"
99
}
1010

11-
fun decode(n: String): Int {
11+
fun decode(n: ByteArray): Int {
1212
return when (n) {
1313
"A" -> 0
1414
"B" -> 1
@@ -50,7 +50,7 @@ class CallLetterNumber {
5050
}
5151
}
5252

53-
fun encode(n: Int): String {
53+
fun encode(n: Int): ByteArray {
5454
return when (n) {
5555
0 -> "A"
5656
1 -> "B"

Codex/src/main/java/org/operatorfoundation/codex/symbols/CallLetterSpace.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CallLetterSpace {
88
return "CallLetterSpace"
99
}
1010

11-
fun decode(n: String): Int {
11+
fun decode(n: ByteArray): Int {
1212
return when (n) {
1313
"A" -> 0
1414
"B" -> 1
@@ -41,7 +41,7 @@ class CallLetterSpace {
4141
}
4242
}
4343

44-
fun encode(n: Int): String {
44+
fun encode(n: Int): ByteArray {
4545
return when (n) {
4646
0 -> "A"
4747
1 -> "B"

Codex/src/main/java/org/operatorfoundation/codex/symbols/GridLetter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class GridLetter {
88
return "GridLetter"
99
}
1010

11-
fun decode(n: String): Int {
11+
fun decode(n: ByteArray): Int {
1212
return when (n) {
1313
"A" -> 0
1414
"B" -> 1
@@ -25,7 +25,7 @@ class GridLetter {
2525
}
2626
}
2727

28-
fun encode(n: Int): String {
28+
fun encode(n: Int): ByteArray {
2929
return when (n) {
3030
0 -> "A"
3131
1 -> "B"

Codex/src/main/java/org/operatorfoundation/codex/symbols/Number.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Number {
88
return "Number"
99
}
1010

11-
fun decode(n: String): Int {
11+
fun decode(n: ByteArray): Int {
1212
return when (n) {
1313
"0" -> 0
1414
"1" -> 1
@@ -24,7 +24,7 @@ class Number {
2424
}
2525
}
2626

27-
fun encode(n: Int): String {
27+
fun encode(n: Int): ByteArray {
2828
return when (n) {
2929
0 -> "0"
3030
1 -> "1"

Codex/src/main/java/org/operatorfoundation/codex/symbols/Power.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Power {
88
return "Power"
99
}
1010

11-
fun decode(n: String): Int {
11+
fun decode(n: ByteArray): Int {
1212
return when (n) {
1313
"0" -> 0
1414
"3" -> 1
@@ -33,7 +33,7 @@ class Power {
3333
}
3434
}
3535

36-
fun encode(n: Int): String {
36+
fun encode(n: Int): ByteArray {
3737
return when (n) {
3838
0 -> "0"
3939
1 -> "3"

Codex/src/main/java/org/operatorfoundation/codex/symbols/Required.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ class Required(private val r: Any) {
88
return "Required($r)"
99
}
1010

11-
fun encode(n: Any): Any {
11+
fun encode(n: Int): ByteArray {
1212
return r
1313
}
1414

15-
fun decode(n: Any) {
15+
fun decode(n: ByteArray): Int {
1616
if (n != r) {
1717
throw IllegalArgumentException("Required($r) != $n")
1818
}

Codex/src/main/java/org/operatorfoundation/codex/symbols/Trinary.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Trinary {
88
return "Trinary"
99
}
1010

11-
fun decode(n: String): Int {
11+
fun decode(n: ByteArray): Int {
1212
return when (n) {
1313
"0" -> 0
1414
"1" -> 1
@@ -17,7 +17,7 @@ class Trinary {
1717
}
1818
}
1919

20-
fun encode(n: Int): String {
20+
fun encode(n: Int): ByteArray {
2121
return when (n) {
2222
0 -> "0"
2323
1 -> "1"

0 commit comments

Comments
 (0)