public class Parser extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Parser.DecimalDigitsInputFilter
The regrex formula to control the nodes weights that can written down by the user.
|
Modifier and Type | Field and Description |
---|---|
static int |
FULL_FILE_IS_CORRECT |
static int |
INCONSISTENT_ID_QUANTITY |
static int |
INVALID_FILE_CONTENT |
static int |
TOO_MANY_COLUMNS_OR_ROWS |
Constructor and Description |
---|
Parser() |
Modifier and Type | Method and Description |
---|---|
static int[][] |
getFileArray(String fileDataUnFiltered)
Get every number into an array, to process later on.
|
static String |
getLetterForInt(int j)
Method to return a letter based on a code to create the first row in the map.
|
static float |
getTextSizeForMap(int length)
Method to adapt the sizes of the map depending on how many tiles the map has.
|
static int |
isValidStringInFile(String fileContent)
We receive a whole document (whichever the user chooses, so be careful with this;
it means this can load anything, like photos or documents, but is only intended
to load incredibly light txt files that go along the project specifications.
|
public static final int FULL_FILE_IS_CORRECT
public static final int INCONSISTENT_ID_QUANTITY
public static final int INVALID_FILE_CONTENT
public static final int TOO_MANY_COLUMNS_OR_ROWS
public static int isValidStringInFile(String fileContent)
fileContent
- The whole file that was actually selected by the user.public static int[][] getFileArray(String fileDataUnFiltered)
fileDataUnFiltered
- the raw file to upload to the program, that
should have any errors, since those are looked for
in the parsing method.public static String getLetterForInt(int j)
j
- the position on the alphabet.public static float getTextSizeForMap(int length)
length
- a base length to process the new calculation.