Moved exception class

This commit is contained in:
2022-01-04 22:55:45 -05:00
parent 7987df7635
commit 64c1767969
5 changed files with 30 additions and 34 deletions

View File

@@ -0,0 +1,21 @@
//CipherStreamJava/src/main/java/mattrixwv/CipherStreamJava/Exceptions/InvalidCharacterException.java
//Mattrixwv
// Created: 01-04-22
//Modified: 01-04-22
package mattrixwv.CipherStreamJava.Exceptions;
public class InvalidCharacterException extends Exception{
public InvalidCharacterException(){
super();
}
public InvalidCharacterException(String message){
super(message);
}
public InvalidCharacterException(Throwable error){
super(error);
}
public InvalidCharacterException(String message, Throwable error){
super(message, error);
}
}

View File

@@ -5,20 +5,9 @@
//This is the declaration of the Playfair class
package mattrixwv.CipherStreamJava;
import mattrixwv.CipherStreamJava.Exceptions.InvalidCharacterException;
public class Playfair{
//An exception to indicate a bad string was given as a parameter
public class InvalidCharacterException extends Exception{
InvalidCharacterException(){
super();
}
InvalidCharacterException(String message){
super(message);
}
InvalidCharacterException(String message, Throwable throwable){
super(message, throwable);
}
}
//A class representing the location of a character in the grid
private class CharLocation{
private int x;

View File

@@ -1,28 +1,14 @@
//CipherStreamJava/src/main/java/mattrixwv/CipherStreamJava/PolybiusSquare.java
//Mattrixwv
// Created: 01-04-21
//Modified: 01-04-21
// Created: 01-04-22
//Modified: 01-04-22
package mattrixwv.CipherStreamJava;
import java.util.StringJoiner;
import mattrixwv.CipherStreamJava.Exceptions.InvalidCharacterException;
public class PolybiusSquare{
//An exception to indicate a bad number was given in the string
//TODO: Move this to a stand alone class
public class InvalidCharacterException extends Exception{
public InvalidCharacterException(){
super();
}
public InvalidCharacterException(String message){
super(message);
}
public InvalidCharacterException(Throwable error){
super(error);
}
public InvalidCharacterException(String message, Throwable error){
super(message, error);
}
}
//A class representing the location of a character in the grid
private class CharLocation{
private int x;

View File

@@ -10,7 +10,7 @@ import static org.junit.Assert.assertEquals;
import org.junit.Test;
import mattrixwv.CipherStreamJava.Playfair.InvalidCharacterException;
import mattrixwv.CipherStreamJava.Exceptions.InvalidCharacterException;
public class TestPlayfair{

View File

@@ -1,7 +1,7 @@
//CipherStreamJava/src/test/java/mattrixwv/CipherStreamJava/TestPolybiusSquare.java
//Mattrixwv
// Created: 01-04-21
//Modified: 01-04-21
// Created: 01-04-22
//Modified: 01-04-22
package mattrixwv.CipherStreamJava;
@@ -9,7 +9,7 @@ import static org.junit.Assert.assertEquals;
import org.junit.Test;
import mattrixwv.CipherStreamJava.PolybiusSquare.InvalidCharacterException;
import mattrixwv.CipherStreamJava.Exceptions.InvalidCharacterException;
public class TestPolybiusSquare{