diff --git a/ArrayListLine.class b/ArrayListLine.class index 3e59f8a..b6ac117 100644 Binary files a/ArrayListLine.class and b/ArrayListLine.class differ diff --git a/ArrayListLine.java b/ArrayListLine.java index 3dad9ff..9a621d6 100644 --- a/ArrayListLine.java +++ b/ArrayListLine.java @@ -1,48 +1,52 @@ -package dds.gr.aueb.dmst.crazydevelopers; - +package gr.aueb.dmst.dds.CrazyDevelopers; + /** ArrayListLine class. * *that will be used as a whole different line in our database + * + * @author oneofthecraziest */ - public class ArrayListLine { - protected String[] line; - // theoretical columns of our data base + protected String[] line; + // theoretical columns of our data base - /** - * Constructor of our class. - * - */ - public ArrayListLine(String[] line) { - this.line = line; - } + /** + * Constructor of our class. + * @param line String Array + */ + public ArrayListLine(String[] line) { + this.line = line; + } - /** - * method that helps changing a specific column of our line. - */ - public void changeColumn(int column, String x) { - line[column] = x; - } + /** + * @param column first int value + * @param x second string value + * method that helps changing a specific column of our line. + */ + public void changeColumn(int column, String x) { + line[column] = x; + } - /** - * Method that prints specific Line, will be used in the class Functions. - */ - public void printLine() { - System.out.print("|"); - for (int i = 0; i < line.length; i++) { - System.out.printf("%15s %5s|",line[i],""); - } - System.out.println("\t"); - } + /** + * Method that prints specific Line, will be used in the class Functions. + */ + public void printLine() { + System.out.print("|"); + for (int i = 0; i < line.length; i++) { + System.out.printf("%15s %5s|",line[i],""); + } + System.out.println("\t"); + } - /** - * Method that returns specific Line in an array, will be used in the class. - * Functions - */ - public String[] getLine() { - String[] x = new String[line.length]; - for (int i = 0; i < line.length; i++) { - x[i] = line[i]; - } - return x; - } + /** + * Method that returns specific Line in an array, will be used in the class. + * Functions + * @return specific line x + */ + public String[] getLine() { + String[] x = new String[line.length]; + for (int i = 0; i < line.length; i++) { + x[i] = line[i]; + } + return x; + } } diff --git a/Exceptions.class b/Exceptions.class index 12f7df7..41a7016 100644 Binary files a/Exceptions.class and b/Exceptions.class differ diff --git a/Exceptions.java b/Exceptions.java index d759541..ff2f00d 100644 --- a/Exceptions.java +++ b/Exceptions.java @@ -1,9 +1,13 @@ -package dds.gr.aueb.dmst.crazydevelopers; +package gr.aueb.dmst.dds.CrazyDevelopers; /* * Class that will be used to check whether an Exception is thrown or not * to guarantee that the program will end normally */ +/** + * @author oneofthecraziest + */ + import java.util.ArrayList; import java.util.InputMismatchException; @@ -16,6 +20,7 @@ public class Exceptions { * Method that reads the choice of the user and checks to see if the value of. * the choice produces the InputMismatchException and ends when the value is * valid and no Exception is thrown + * @return choice of the user */ public int notIntegerException() { int choice = 0; @@ -35,7 +40,10 @@ public int notIntegerException() { return choice; } - // Method that it initializes the variable x + /** + * Method that it initializes the variable x + * @param x string value + */ public void display(String x) { text = x; } @@ -44,6 +52,9 @@ public void display(String x) { * Method that checks if the value that the user gives throws the. * InputMismatchException or the ArrayOutOfBoundsException and ends when none of * the above Exceptions are thrown + * @param x1 int value + * @param lists ArrayList of ArrayListLine + * @return x1 */ public int outOfBoundsException(ArrayList[] lists, int x1) { int exit = 0; @@ -61,6 +72,10 @@ public int outOfBoundsException(ArrayList[] lists, int x1) { /** * Method used for the same reason but with one more argument because we need to. * get to second dimension of the array lists + * @param x1 first int value + * @param list second int value + * @param lists ArrayList of ArrayListLine + * @return x1 */ public int outOfBoundsException(ArrayList[] lists, int x1, int list) { int exit = 0; @@ -76,8 +91,12 @@ public int outOfBoundsException(ArrayList[] lists, int x1, int li } /** - * Method used for the same reason but with different arguments because we need. - * to use the features for every list + * Method used for the same reason but with one more argument because we need to. + * get to second dimension of the array lists + * @param x1 first int value + * @param list second int value + * @param arrayNumberColumns String Array + * @return x1 */ public int outOfBoundsException(int[] arrayNumberColumns, int x1, int list) { int exit = 0; @@ -95,6 +114,9 @@ public int outOfBoundsException(int[] arrayNumberColumns, int x1, int list) { /** * Method used to check if there is data to a specific table. * If there is no data in the DataBase return true otherwise false + * @param list first int value + * @param lists ArrayList of ArrayListLine + * @return exit boolean value */ public boolean noDataBaseException(ArrayList[] lists, int list) { boolean exit = false; diff --git a/Functions.class b/Functions.class index 9ee32ac..bb7bcc1 100644 Binary files a/Functions.class and b/Functions.class differ diff --git a/Functions.java b/Functions.java index da8174f..695049d 100644 --- a/Functions.java +++ b/Functions.java @@ -1,11 +1,10 @@ -package dds.gr.aueb.dmst.crazydevelopers; +package gr.aueb.dmst.dds.CrazyDevelopers; /** *Class that contains necessary functions for our database: * input of data , data presentation, delete and change of data */ -import dds.gr.aueb.dmst.crazydevelopers.Exceptions; import java.io.IOException; import java.io.PrintWriter; @@ -20,6 +19,7 @@ public class Functions { /** * Constructor of our class Sets length of our array of array lists. + * @param num int value */ @SuppressWarnings("unchecked") @@ -30,8 +30,10 @@ public Functions(int num) { } } - /* + /** * Method that adds a new object(line) to a specific list + * @param num int value + * @param object arraylistline */ public void addLine(ArrayListLine object, int num) { lists[num].add(object); @@ -41,6 +43,8 @@ public void addLine(ArrayListLine object, int num) { * Method that allows user to add the new line to a table Asks for the number of * table to add a new line and then asks for the Strings for every column After * it creates a new line using the addLine(...) method. + * @param arrayNumberColumns array of int values + * @param names array of string values */ public void addChoice(int[] arrayNumberColumns, String[][] names) { features = arrayNumberColumns; @@ -57,8 +61,10 @@ public void addChoice(int[] arrayNumberColumns, String[][] names) { addLine(xx, tableAdd - 1); } - /* + /** * Method that deletes an object(line) + * @param rem first int value + * @param num second int value */ public void delete(int rem, int num) { lists[num].remove(rem); @@ -68,6 +74,7 @@ public void delete(int rem, int num) { * Method that deletes a specific line of a specific table Asks user to input * number of table and number of line Uses method delete of class Functions to * do so. + * */ public void deleteChoice() { ex.display("Select list to delete an item: "); @@ -87,6 +94,9 @@ public void deleteChoice() { /** * Method that prints a specific object of a list and the names of the columns, * all given by the user. + * @param list first int value + * @param num2 second int value + * @param names array of string values */ public void print(int list, int num2, String[][] names) { if (num2 == 0) { @@ -102,6 +112,8 @@ public void print(int list, int num2, String[][] names) { /** * Method that prints all the lines and columns(all the objects ArrayListLine * there are) of the existing tables Uses the method print of Functions to do so. + * @param names array of string values + * @param namesT array of string values */ public void printChoice(String[] namesT, String[][] names) { for (int i = 0; i < lists.length; i++) { @@ -113,8 +125,13 @@ public void printChoice(String[] namesT, String[][] names) { } } - /* + + /** * Method that changes an object of a specific line + * @param list first int value + * @param line second int value + * @param column third int value + * @param change fourth string value */ public void change(int list, int line, int column, String change) { lists[list].get(line).changeColumn(column, change); @@ -127,6 +144,7 @@ public void change(int list, int line, int column, String change) { * whole line , he inputs all the different columns otherwise he clarifies which * column he wants to change and goes on to change it This method uses the * method change of class Functions to do so. + * @param arrayNumberColumns array of int values */ public void changeChoice(int[] arrayNumberColumns) { ex.display("Select 1 to change a whole line and 2 to change a specific column: "); @@ -168,6 +186,10 @@ public void changeChoice(int[] arrayNumberColumns) { /** * Method to add to an already existing file named by the user file has the same * output as the print choice above. + * @param path string value + * @param name string value + * @param names array of string values + * @param namesT array of string values */ public void fileAdd(String path, String name, String[]namesT, String[][] names) { try { diff --git a/Main2.class b/Main2.class index 11335be..a36b723 100644 Binary files a/Main2.class and b/Main2.class differ diff --git a/Main2.java b/Main2.java index 7ca73f7..70adc2b 100644 --- a/Main2.java +++ b/Main2.java @@ -1,10 +1,12 @@ -package dds.gr.aueb.dmst.crazydevelopers; +package gr.aueb.dmst.dds.CrazyDevelopers; -import dds.gr.aueb.dmst.crazydevelopers.Functions; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; +/** + * @author oneofthecraziest + */ /* * Main method to run the program @@ -16,8 +18,8 @@ public class Main2 { static String[] testnamesT; /** * Main method. + * @param args String Array */ - public static void main(String[] args) { Menu menu = new Menu(); //new Menu object called menu int numTables = menu.openingMenu(); // User enters amount of tables for data base diff --git a/Menu.class b/Menu.class index a150b01..d040e65 100644 Binary files a/Menu.class and b/Menu.class differ diff --git a/Menu.java b/Menu.java index 60de8c4..650519d 100644 --- a/Menu.java +++ b/Menu.java @@ -1,8 +1,11 @@ -package dds.gr.aueb.dmst.crazydevelopers; +package gr.aueb.dmst.dds.CrazyDevelopers; /* * Class that contains all the menus needed for the program */ +/** + * @author oneofthecraziest + */ import java.util.Scanner; @@ -14,7 +17,7 @@ public class Menu { Scanner input = new Scanner(System.in); /** * Method that asks user to enter the number of tables for the database and - * return this integer. + * @return this integer. */ public int openingMenu() { @@ -28,6 +31,7 @@ public int openingMenu() { } /** * Method that prints the menu to the screen and returns the choice of the user. + * @return choice for function */ public int choiceForFunctions() { @@ -42,6 +46,9 @@ public int choiceForFunctions() { * position of the table by asking user to enter positive numbers for example if * columnPerTable={3,5,1} means that table 1 has 3 columns , table 2 has 5 * columns, table 3 has 1 column returns this table. + * @param tables int value + * @return columnPerTable + * */ public int[] menuColumns(int tables) { columnPerTable = new int[tables]; @@ -63,6 +70,7 @@ public int[] menuColumns(int tables) { * user wants and columns the number of columns of the specific table. The user * gives the names for each column of every table and the method inserts these names * into the two-dimension array names[][] + * @param columnPerTable array of int values */ public void addNames(int[] columnPerTable) { names = new String[columnPerTable.length][]; @@ -78,6 +86,7 @@ public void addNames(int[] columnPerTable) { /** * Method to give user the opportunity to name every table of the DataBase * The table names are saved in the one-dimension array namesT[]. + * @param tables int value */ public void nameTables(int tables) { namesT = new String[tables]; @@ -92,6 +101,7 @@ public void nameTables(int tables) { * or wants to use the default one (User press 1) * The default path is C:\\Users/Public\\ and it is declared by us (User press 2) * Returns the choice that the user makes,which is 1 or 2. + * @return choice of customer */ public int findChoice() { ex.display("Enter 1 if you want it to enter the path you want to save the file in" @@ -130,10 +140,11 @@ public void printModel() { } } - /* + /** * Simple get methods for names[][] and namesT[] * Will be used by Main2 class * Useful for the addChoice() and printChoice() + * @return names */ public String[][] getNames() { return names;