Skip to content

Commit 309bd99

Browse files
author
Dr. Brandon Wiley
committed
All tests pass!
1 parent d143470 commit 309bd99

File tree

16 files changed

+560
-119
lines changed

16 files changed

+560
-119
lines changed

Codex/src/main/java/org/operatorfoundation/codex/Symbol.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface SymbolFactory<T: Symbol>
1010
* Returns the number of possible values this symbol can represent.
1111
* For example, Binary returns 2, Byte returns 256.
1212
*/
13-
fun size(): Int
13+
fun size(): BigInteger
1414
}
1515

1616
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Binary(val value: Int) : Symbol {
77
companion object : SymbolFactory<Binary> {
88
const val MAX = 1
99

10-
override fun size(): Int = MAX + 1
10+
override fun size(): BigInteger = (MAX + 1).toBigInteger()
1111

1212
/**
1313
* Encodes a numeric value to its byte array representation.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CallAny(val value: Char) : Symbol {
2222
)
2323
private val valueToChar = charToValue.map { (k, v) -> v to k }.toMap()
2424

25-
override fun size(): Int = 37
25+
override fun size(): BigInteger = 37.toBigInteger()
2626

2727
override fun encode(numericValue: BigInteger): CallAny {
2828
val int = numericValue.toInt()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CallLetter(val value: Char) : Symbol {
1818
)
1919
private val valueToChar = charToValue.map { (k, v) -> v to k }.toMap()
2020

21-
override fun size(): Int = 26
21+
override fun size(): BigInteger = 26.toBigInteger()
2222

2323
override fun encode(numericValue: BigInteger): CallLetter {
2424
val int = numericValue.toInt()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CallLetterNumber(val value: Char) : Symbol {
2121
)
2222
private val valueToChar = charToValue.map { (k, v) -> v to k }.toMap()
2323

24-
override fun size(): Int = 36
24+
override fun size(): BigInteger = 36.toBigInteger()
2525

2626
override fun encode(numericValue: BigInteger): CallLetterNumber {
2727
val int = numericValue.toInt()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CallLetterSpace(val value: Char) : Symbol {
1919
)
2020
private val valueToChar = charToValue.map { (k, v) -> v to k }.toMap()
2121

22-
override fun size(): Int = 27
22+
override fun size(): BigInteger = 27.toBigInteger()
2323

2424
override fun encode(numericValue: BigInteger): CallLetterSpace {
2525
val int = numericValue.toInt()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CallNumber(val value: Char) : Symbol {
1313
)
1414
private val valueToChar = charToValue.map { (k, v) -> v to k }.toMap()
1515

16-
override fun size(): Int = 10
16+
override fun size(): BigInteger = 10.toBigInteger()
1717

1818
override fun encode(numericValue: BigInteger): CallNumber {
1919
val int = numericValue.toInt()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class GridLetter(val value: Char) : Symbol {
1515
)
1616
private val valueToChar = charToValue.map { (k, v) -> v to k }.toMap()
1717

18-
override fun size(): Int = 18
18+
override fun size(): BigInteger = 18.toBigInteger()
1919

2020
override fun encode(numericValue: BigInteger): GridLetter {
2121
val int = numericValue.toInt()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class GridNumber(val value: Char) : Symbol {
1313
)
1414
private val valueToChar = charToValue.map { (k, v) -> v to k }.toMap()
1515

16-
override fun size(): Int = 10
16+
override fun size(): BigInteger = 10.toBigInteger()
1717

1818
override fun encode(numericValue: BigInteger): GridNumber {
1919
val int = numericValue.toInt()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Octet(val value: Int) : Symbol {
77
companion object : SymbolFactory<Octet> {
88
const val MAX = 255
99

10-
override fun size(): Int = MAX + 1
10+
override fun size(): BigInteger = (MAX + 1).toBigInteger()
1111

1212
/**
1313
* Encodes a numeric value to its byte array representation.

0 commit comments

Comments
 (0)