All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javaParse.Checker

java.lang.Object
   |
   +----javaParse.Checker

public class Checker
extends Object
class Checker checker treats everything as double arrays such that when constructed with an array treats it as a matrix of colLength ==1. this allows for checking to be handled at a lower level for GUI such that we don't have to differentiate between tables and other windows since all are comparing Strings that are either equal or not Also -- equal is defined as same number of characters in any order such that aegb == aebg IF no spaces otherwise equality is: ae gb == gb ae ae gb != bg ae.


Constructor Index

 o Checker(String[], boolean)
 o Checker(String[][], boolean)

Method Index

 o check(int, int, String)
 o getAnswers()

Constructors

 o Checker
 public Checker(String answers[],
                boolean isSortedAndSpaceFree)
Parameters:
answers - the correct chars
isSorted - true if Strings in answers have no spaces AND are sorted
 o Checker
 public Checker(String answers[][],
                boolean isSortedAndSpaceFree)
Parameters:
answers - the correct chars
isSorted - true if Strings in answers have no spaces AND are sorted

Methods

 o check
 public boolean check(int row,
                      int col,
                      String guess)
Parameters:
row - row index to String that you wish to check
col - col index to String that you wish to check
guess - will be compared to String at [row][col]
Returns:
true if all chars (even spaces) in guess are in answer stored at [row][col] && all chars in [row][col] are in guess ie "aa a bb b" == "a b aa bb" but != "ab aa bb" since a space is missing
 o getAnswers
 public String[][] getAnswers()
Returns:
the matrix of answers that was originally passed in if a String[] was used to Construct checker, then this function still returns a matrix of colSize == 1

All Packages  Class Hierarchy  This Package  Previous  Next  Index