public int getCount(String type, int i) {
        int result = 0;
        String line = "";
        
        if(type.equals("row")) {
            line = jTable.getRow(i);
        } else if(type.equals("column")) {
            line = jTable.getColumn(i);
        } else if(type.equals("diagonal")) {
            line = jTable.getDiagonal();
        } else if(type.equals("inverse")) {
            line = jTable.getInverse();
        }
        if(line.contains(" ")) {
            result -= StringUtils.countMatches(line, "X");
            result += StringUtils.countMatches(line, "O");
        } else {
            result = -(line.length() + 1);
        }
        
        return result;
    }