From e54c53c7c796868fb06a437c93dffbdaedbf16ac Mon Sep 17 00:00:00 2001 From: bhimio Date: Thu, 21 Apr 2022 08:25:58 -0400 Subject: [PATCH 01/12] almost finished --- .../src/App.java | 2 +- mod2/Librairy/src/App.java | 10 ++-- mod2/Librairy/src/console/Console.java | 32 +++++++---- mod2/Librairy/src/dao/LibraryFileImpl.java | 53 ++++++++++++++--- .../Librairy/src/dao/LibraryInMemoryImpl.java | 57 +++++++++++-------- .../src/interfaces/LibraryInterface.java | 10 ++++ mod2/Librairy/src/model/Book.java | 17 ++---- mod2/Librairy/src/model/Client.java | 5 +- .../.vscode/settings.json | 7 --- mod2/hopenlop aka simple java I O/README.md | 18 ------ 10 files changed, 122 insertions(+), 89 deletions(-) rename mod2/{hopenlop aka simple java I O => Class roster}/src/App.java (66%) delete mode 100644 mod2/hopenlop aka simple java I O/.vscode/settings.json delete mode 100644 mod2/hopenlop aka simple java I O/README.md diff --git a/mod2/hopenlop aka simple java I O/src/App.java b/mod2/Class roster/src/App.java similarity index 66% rename from mod2/hopenlop aka simple java I O/src/App.java rename to mod2/Class roster/src/App.java index 7e88056..0a839f9 100644 --- a/mod2/hopenlop aka simple java I O/src/App.java +++ b/mod2/Class roster/src/App.java @@ -1,5 +1,5 @@ public class App { public static void main(String[] args) throws Exception { - + System.out.println("Hello, World!"); } } diff --git a/mod2/Librairy/src/App.java b/mod2/Librairy/src/App.java index 82f7217..f03083f 100644 --- a/mod2/Librairy/src/App.java +++ b/mod2/Librairy/src/App.java @@ -23,7 +23,7 @@ public static void main(String[] args) throws Exception { String getBookNamePrompt = "what is the title of this book"; String getBookAuthorPrompt = "who is the author of this book"; String getBookGenrePrompt = "which genre is this book located"; - //String getBookIdPrompt = "what is the id of this book"; + // String getBookIdPrompt = "what is the id of this book"; String getBookTypePrompt = "what type will you serch by"; impl.install(); System.out.println("welcome to the library"); @@ -42,9 +42,9 @@ public static void main(String[] args) throws Exception { break; case 2: bookType = console.getString(getBookTypePrompt); - if ( !bookType.equals("author") && !bookType.equals("genre")) { + if (!bookType.equals("author") && !bookType.equals("genre")) { sampleBook = impl.findType(bookType, sampleBook); - if (sampleBook != null ){ + if (sampleBook != null) { console.printBook(sampleBook); } } else if (bookType.equals("author") || bookType.equals("genre")) { @@ -53,14 +53,14 @@ public static void main(String[] args) throws Exception { console.printBook(sampleList); } } - + break; case 3: impl.print(); break; case 4: bookType = console.getString(getBookTypePrompt); - if (!bookType.equals("author") && !bookType.equals("Genre")){ + if (!bookType.equals("author") && !bookType.equals("Genre")) { sampleBook = impl.findType(bookType, sampleBook); if (sampleBook != null && sampleBook.getCheckedOut() == false) { impl.checkOut(sampleBook, true); diff --git a/mod2/Librairy/src/console/Console.java b/mod2/Librairy/src/console/Console.java index 6766c64..f5b3fa8 100644 --- a/mod2/Librairy/src/console/Console.java +++ b/mod2/Librairy/src/console/Console.java @@ -7,12 +7,13 @@ public class Console { private Scanner sc; + public Console(Scanner sc) { this.sc = sc; } - public void printMenue(){ - + public void printMenue() { + System.out.println("1: add a book to the library"); System.out.println("2: search for a book in the librairy"); System.out.println("3: list the books in the librairy"); @@ -20,6 +21,7 @@ public void printMenue(){ System.out.println("5: return a book to the librairy"); System.out.println("6: exit the librairy"); } + public void printBook(Book book) { System.out.println("___________________________"); System.out.println("title: " + book.getTitle()); @@ -29,16 +31,18 @@ public void printBook(Book book) { System.out.println("is checked out: " + book.getCheckedOut()); System.out.println("___________________________"); } + public void printBook(List librairyList) { for (Book book : librairyList) { this.printBook(book); } } + public int getInt(String prompt) { boolean isCorrect = false; int value = 0; String userInput; - while(!isCorrect) { + while (!isCorrect) { System.out.println(prompt); userInput = this.sc.nextLine(); try { @@ -47,14 +51,15 @@ public int getInt(String prompt) { } catch (Exception e) { System.out.println("That was not a int. Please try again"); } - } + } return value; } + public float getFloat(String prompt) { boolean isCorrect = false; float value = 0; String userInput; - while(!isCorrect) { + while (!isCorrect) { System.out.println(prompt); userInput = this.sc.nextLine(); try { @@ -63,14 +68,15 @@ public float getFloat(String prompt) { } catch (Exception e) { System.out.println("That was not a float. Please try again"); } - } + } return value; } + public double getDouble(String prompt) { boolean isCorrect = false; double value = 0; String userInput; - while(!isCorrect) { + while (!isCorrect) { System.out.println(prompt); userInput = this.sc.nextLine(); try { @@ -79,14 +85,15 @@ public double getDouble(String prompt) { } catch (Exception e) { System.out.println("That was not a double. Please try again"); } - } + } return value; } + public boolean getboolean(String prompt) { boolean isCorrect = false; boolean value = false; String userInput; - while(!isCorrect) { + while (!isCorrect) { userInput = this.getString(prompt); try { value = Boolean.parseBoolean(userInput); @@ -94,19 +101,20 @@ public boolean getboolean(String prompt) { } catch (Exception e) { System.out.println("That was not a boolean. Please try again"); } - } + } return value; } + public String getString(String prompt) { System.out.println(prompt); return this.sc.nextLine(); } - public boolean getYesOrNo(String prompt, String yes, String no){ + public boolean getYesOrNo(String prompt, String yes, String no) { String whatToDo = null; boolean satifaction = false; boolean yn = false; - + do { System.out.println(prompt + " " + yes + "/" + no); whatToDo = sc.nextLine(); diff --git a/mod2/Librairy/src/dao/LibraryFileImpl.java b/mod2/Librairy/src/dao/LibraryFileImpl.java index 5b86300..d4021fb 100644 --- a/mod2/Librairy/src/dao/LibraryFileImpl.java +++ b/mod2/Librairy/src/dao/LibraryFileImpl.java @@ -1,17 +1,35 @@ package dao; +import java.io.BufferedReader; +import java.io.FileReader; import java.io.PrintWriter; +import java.util.ArrayList; import java.util.List; +import java.util.Scanner; +import console.Console; import interfaces.LibraryInterface; import model.Book; import model.Client; -public class LibraryFileImpl implements LibraryInterface{ +public class LibraryFileImpl implements LibraryInterface { + private List libraryList = new ArrayList<>(); + private static int id; + private static Scanner scanner = new Scanner(System.in); + private static Console console = new Console(scanner); @Override public void create(Book book, PrintWriter writer) { - writer.println(book.getTitle() + "::" + book.getAuthor() + "::" + book.getGenre() + "::" + book.getCheckedOut() + "::" + book.getId()); + book.setId(id++); + book.setCheckedOut(false); + libraryList.add(book); + for (Book book2 : libraryList) { + writer.println( + book2.getTitle() + "::" + book2.getAuthor() + "::" + book2.getGenre() + "::" + book2.getCheckedOut() + + "::" + book2.getId()); + writer.flush(); + writer.close(); + } } @Override @@ -40,20 +58,19 @@ public List searchByGenre(String value) { @Override public void checkOut(Book book, boolean checkedOut) { - // TODO Auto-generated method stub - + } @Override public Client create(Client client) { - // TODO Auto-generated method stub return null; } @Override public void print() { - // TODO Auto-generated method stub - + for (Book book : libraryList) { + console.printBook(book); + } } @Override @@ -70,7 +87,25 @@ public List findType(String bookType, List sampleList) { @Override public void install() throws Exception { - + Scanner read = new Scanner( + new BufferedReader(new FileReader("/home/bhima/dev/mod2/Librairy/src/storage/OutFile.txt"))); + String[] parts; + String line; + while (read.hasNextLine()) { + line = read.nextLine(); + parts = line.split("::"); + Book b = new Book(); + b.setTitle(parts[0]); + b.setAuthor(parts[1]); + b.setGenre(parts[2]); + b.setCheckedOut(Boolean.parseBoolean(parts[3])); + b.setId(Integer.parseInt(parts[4])); + // add to in memory list for fast lookup + libraryList.add(b); + if (!read.hasNextLine()) { + this.id = Integer.parseInt(parts[4]) + 1; + } + } + } - } diff --git a/mod2/Librairy/src/dao/LibraryInMemoryImpl.java b/mod2/Librairy/src/dao/LibraryInMemoryImpl.java index a1f3d9d..4168e10 100644 --- a/mod2/Librairy/src/dao/LibraryInMemoryImpl.java +++ b/mod2/Librairy/src/dao/LibraryInMemoryImpl.java @@ -13,10 +13,10 @@ import model.Book; import model.Client; -public class LibraryInMemoryImpl implements LibraryInterface{ +public class LibraryInMemoryImpl implements LibraryInterface { private List libraryList = new ArrayList<>(); private HashMap librairyMap = new HashMap<>(); - //private List clientList = new ArrayList<>(); + // private List clientList = new ArrayList<>(); private static int id; private static int id2; Scanner sc = new Scanner(System.in); @@ -24,16 +24,18 @@ public class LibraryInMemoryImpl implements LibraryInterface{ public Book wrongBook = new Book("uh oh", "uh oh", "uh oh"); @Override - public void create(Book book, PrintWriter writer){ + public void create(Book book, PrintWriter writer) { book.setId(id++); book.setCheckedOut(false); libraryList.add(book); - writer.println(book.getTitle() + "::" + book.getAuthor() + "::" + book.getGenre() + "::" + book.getCheckedOut() + "::" + book.getId()); + writer.println(book.getTitle() + "::" + book.getAuthor() + "::" + book.getGenre() + "::" + book.getCheckedOut() + + "::" + book.getId()); writer.flush(); writer.close(); } + @Override - public Book searchById(String value){ + public Book searchById(String value) { int id; try { id = Integer.parseInt(value); @@ -47,17 +49,19 @@ public Book searchById(String value){ } return null; } + @Override - public Book searchByName(String value){ - for (Book b: libraryList) { + public Book searchByName(String value) { + for (Book b : libraryList) { if (value.equals(b.getTitle())) { return b; } } return null; } + @Override - public List searchByAuthor(String value){ + public List searchByAuthor(String value) { List bookList = new ArrayList<>(); for (Book b : libraryList) { if (value.equals(b.getAuthor())) { @@ -66,6 +70,7 @@ public List searchByAuthor(String value){ } return bookList; } + @Override public List searchByGenre(String value) { List bookList = new ArrayList<>(); @@ -76,29 +81,32 @@ public List searchByGenre(String value) { } return bookList; } + @Override - public void checkOut(Book book, boolean checkedOut){ + public void checkOut(Book book, boolean checkedOut) { this.searchByName(book.getTitle()).setCheckedOut(checkedOut); } @Override - public Client create(Client client){ + public Client create(Client client) { client.setId(id2++); client.setAge(client.getAge()); client.setBooks(client.getBooks()); client.setName(client.getName()); return client; } + @Override public void print() { - for (Book b : libraryList) { - console.printBook(b); - } + for (Book b : libraryList) { + console.printBook(b); + } } + @Override public Book findType(String bookType, Book sampleBook) { - + String getBookNamePrompt = "what is the title of this book"; String getBookAuthorPrompt = "who is the author of this book"; String getBookIdPrompt = "what is the id of this book"; @@ -128,7 +136,7 @@ public Book findType(String bookType, Book sampleBook) { } @Override - public List findType(String bookType, List sampleList){ + public List findType(String bookType, List sampleList) { String getBookAuthorPrompt = "who is the author of this book"; String getBookGenrePrompt = "which genre is this book located"; @@ -155,14 +163,15 @@ public List findType(String bookType, List sampleList){ } return null; } - + @Override - public void install() throws Exception{ - Scanner read = new Scanner(new BufferedReader(new FileReader("/home/bhima/dev/mod2/Librairy/src/storage/OutFile.txt"))); - String[] parts; - String line; - boolean ischeckedout; - int id; + public void install() throws Exception { + Scanner read = new Scanner( + new BufferedReader(new FileReader("/home/bhima/dev/mod2/Librairy/src/storage/OutFile.txt"))); + String[] parts; + String line; + boolean ischeckedout; + int id; while (read.hasNextLine()) { line = read.nextLine(); parts = line.split("::"); @@ -172,9 +181,9 @@ public void install() throws Exception{ b.setAuthor(parts[1]); b.setTitle(parts[0]); b.setCheckedOut(ischeckedout); - b.setGenre(parts [2]); + b.setGenre(parts[2]); b.setId(id); - //add to in memory list for fast lookup + // add to in memory list for fast lookup libraryList.add(b); if (!read.hasNextLine()) { this.id = id; diff --git a/mod2/Librairy/src/interfaces/LibraryInterface.java b/mod2/Librairy/src/interfaces/LibraryInterface.java index 5c764be..02bb331 100644 --- a/mod2/Librairy/src/interfaces/LibraryInterface.java +++ b/mod2/Librairy/src/interfaces/LibraryInterface.java @@ -8,15 +8,25 @@ public interface LibraryInterface { public void create(Book book, PrintWriter writer); + public Book searchById(String value); + public Book searchByName(String value); + public List searchByAuthor(String value); + public List searchByGenre(String value); + public void checkOut(Book book, boolean checkedOut); + public Client create(Client client); + public void print(); + public Book findType(String bookType, Book sampleBook); + public List findType(String bookType, List sampleList); + public void install() throws Exception; // public boolean delete(String value, String type); } diff --git a/mod2/Librairy/src/model/Book.java b/mod2/Librairy/src/model/Book.java index 79a7453..bae8de5 100644 --- a/mod2/Librairy/src/model/Book.java +++ b/mod2/Librairy/src/model/Book.java @@ -8,13 +8,11 @@ public class Book { private String genre; private boolean checkedOut; - - - public Book () { + public Book() { } - public Book (String title, String author, String genre) { + public Book(String title, String author, String genre) { this.title = title; this.author = author; this.genre = genre; @@ -28,8 +26,6 @@ public void setCheckedOut(Boolean checkedOut) { this.checkedOut = checkedOut; } - - public String getGenre() { return this.genre; } @@ -37,6 +33,7 @@ public String getGenre() { public void setGenre(String genre) { this.genre = genre; } + public boolean isIsAvailable() { return this.isAvailable; } @@ -45,8 +42,6 @@ public void setIsAvailable(boolean isAvailable) { this.isAvailable = isAvailable; } - - public String getTitle() { return this.title; } @@ -71,9 +66,9 @@ public void setId(int id) { this.id = id; } - public String toString () { - + public String toString() { + return ""; } - + } diff --git a/mod2/Librairy/src/model/Client.java b/mod2/Librairy/src/model/Client.java index e83dc8e..dabcbc0 100644 --- a/mod2/Librairy/src/model/Client.java +++ b/mod2/Librairy/src/model/Client.java @@ -6,11 +6,11 @@ public class Client { private int age; private int books; - public Client(){ + public Client() { } - public Client(int id, String name, int age){ + public Client(int id, String name, int age) { this.age = age; this.id = id; this.name = name; @@ -23,6 +23,7 @@ public int getBooks() { public void setBooks(int books) { this.books = books; } + public int getId() { return this.id; } diff --git a/mod2/hopenlop aka simple java I O/.vscode/settings.json b/mod2/hopenlop aka simple java I O/.vscode/settings.json deleted file mode 100644 index e112a70..0000000 --- a/mod2/hopenlop aka simple java I O/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "java.project.sourcePaths": ["src"], - "java.project.outputPath": "bin", - "java.project.referencedLibraries": [ - "lib/**/*.jar" - ] -} diff --git a/mod2/hopenlop aka simple java I O/README.md b/mod2/hopenlop aka simple java I O/README.md deleted file mode 100644 index 7c03a53..0000000 --- a/mod2/hopenlop aka simple java I O/README.md +++ /dev/null @@ -1,18 +0,0 @@ -## Getting Started - -Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. - -## Folder Structure - -The workspace contains two folders by default, where: - -- `src`: the folder to maintain sources -- `lib`: the folder to maintain dependencies - -Meanwhile, the compiled output files will be generated in the `bin` folder by default. - -> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. - -## Dependency Management - -The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). From babdf14ddcaff98b7f7cd53c399d076a01d69b16 Mon Sep 17 00:00:00 2001 From: bhimio Date: Sun, 24 Apr 2022 18:30:50 -0400 Subject: [PATCH 02/12] what should i do whith find type --- mod2/Librairy/src/console/Console.java | 12 +++---- mod2/Librairy/src/dao/LibraryFileImpl.java | 41 +++++++++++++++++----- mod2/Librairy/src/storage/OutFile.txt | 2 +- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/mod2/Librairy/src/console/Console.java b/mod2/Librairy/src/console/Console.java index f5b3fa8..eb83fa2 100644 --- a/mod2/Librairy/src/console/Console.java +++ b/mod2/Librairy/src/console/Console.java @@ -43,8 +43,7 @@ public int getInt(String prompt) { int value = 0; String userInput; while (!isCorrect) { - System.out.println(prompt); - userInput = this.sc.nextLine(); + userInput = this.getString(prompt); try { value = Integer.parseInt(userInput); isCorrect = true; @@ -60,8 +59,7 @@ public float getFloat(String prompt) { float value = 0; String userInput; while (!isCorrect) { - System.out.println(prompt); - userInput = this.sc.nextLine(); + userInput = this.getString(prompt); try { value = Float.parseFloat(userInput); isCorrect = true; @@ -77,8 +75,7 @@ public double getDouble(String prompt) { double value = 0; String userInput; while (!isCorrect) { - System.out.println(prompt); - userInput = this.sc.nextLine(); + userInput = this.getString(prompt); try { value = Double.parseDouble(userInput); isCorrect = true; @@ -116,8 +113,7 @@ public boolean getYesOrNo(String prompt, String yes, String no) { boolean yn = false; do { - System.out.println(prompt + " " + yes + "/" + no); - whatToDo = sc.nextLine(); + whatToDo = this.getString(prompt + " " + yes + "/" + no); if (whatToDo.equals(yes)) { yn = true; satifaction = true; diff --git a/mod2/Librairy/src/dao/LibraryFileImpl.java b/mod2/Librairy/src/dao/LibraryFileImpl.java index d4021fb..a1e17f0 100644 --- a/mod2/Librairy/src/dao/LibraryFileImpl.java +++ b/mod2/Librairy/src/dao/LibraryFileImpl.java @@ -17,6 +17,7 @@ public class LibraryFileImpl implements LibraryInterface { private static int id; private static Scanner scanner = new Scanner(System.in); private static Console console = new Console(scanner); + public Book wrongBook = new Book("uh oh", "uh oh", "uh oh"); @Override public void create(Book book, PrintWriter writer) { @@ -34,31 +35,55 @@ public void create(Book book, PrintWriter writer) { @Override public Book searchById(String value) { - // TODO Auto-generated method stub + int id; + try { + id = Integer.parseInt(value); + for (Book b : libraryList) { + if (id == b.getId()) { + return b; + } + } + } catch (Exception e) { + return wrongBook; + } return null; } @Override public Book searchByName(String value) { - // TODO Auto-generated method stub + for (Book b : libraryList) { + if (value.equals(b.getTitle())) { + return b; + } + } return null; } @Override public List searchByAuthor(String value) { - // TODO Auto-generated method stub - return null; + List bookList = new ArrayList<>(); + for (Book b : libraryList) { + if (value.equals(b.getAuthor())) { + bookList.add(b); + } + } + return bookList; } @Override public List searchByGenre(String value) { - // TODO Auto-generated method stub - return null; + List bookList = new ArrayList<>(); + for (Book b : libraryList) { + if (value.equals(b.getGenre())) { + bookList.add(b); + } + } + return bookList; } @Override public void checkOut(Book book, boolean checkedOut) { - + this.searchByName(book.getTitle()).setCheckedOut(checkedOut); } @Override @@ -103,7 +128,7 @@ public void install() throws Exception { // add to in memory list for fast lookup libraryList.add(b); if (!read.hasNextLine()) { - this.id = Integer.parseInt(parts[4]) + 1; + id = Integer.parseInt(parts[4]) + 1; } } diff --git a/mod2/Librairy/src/storage/OutFile.txt b/mod2/Librairy/src/storage/OutFile.txt index df29ab0..c7b0cc3 100644 --- a/mod2/Librairy/src/storage/OutFile.txt +++ b/mod2/Librairy/src/storage/OutFile.txt @@ -1 +1 @@ -fyfyus::hasgfgdfh::sfgsfg::false::0 +fyfyus::hasgfgdfh::sfgsfg::false::0 \ No newline at end of file From ef05adadbb977d61a2ab0639af63a4c6f021e9dd Mon Sep 17 00:00:00 2001 From: bhimio Date: Wed, 27 Apr 2022 14:41:24 -0400 Subject: [PATCH 03/12] this is for you --- mod2/Class roster/src/App.java | 5 +- mod2/Class roster/src/IO/ClassRosterView.java | 18 ++ mod2/Class roster/src/IO/Console.java | 174 ++++++++++++++++++ .../src/controller/ClassRosterControl.java | 45 +++++ .../src/interfaces/ClassRosterDao.java | 5 + .../src/interfaces/ConsoleIo.java | 16 ++ mod2/Class roster/src/model/student.java | 5 + mod2/Class roster/src/storage/OutFile.txt | 0 mod2/Librairy/src/storage/OutFile.txt | 2 +- mod2/d&d.vs/src/modle/Person.java | 9 +- mod2/d&d.vs/src/modle/item.java | 3 +- 11 files changed, 276 insertions(+), 6 deletions(-) create mode 100644 mod2/Class roster/src/IO/ClassRosterView.java create mode 100644 mod2/Class roster/src/IO/Console.java create mode 100644 mod2/Class roster/src/controller/ClassRosterControl.java create mode 100644 mod2/Class roster/src/interfaces/ClassRosterDao.java create mode 100644 mod2/Class roster/src/interfaces/ConsoleIo.java create mode 100644 mod2/Class roster/src/model/student.java create mode 100644 mod2/Class roster/src/storage/OutFile.txt diff --git a/mod2/Class roster/src/App.java b/mod2/Class roster/src/App.java index 0a839f9..1af8874 100644 --- a/mod2/Class roster/src/App.java +++ b/mod2/Class roster/src/App.java @@ -1,5 +1,8 @@ +import controller.ClassRosterControl; + public class App { public static void main(String[] args) throws Exception { - System.out.println("Hello, World!"); + ClassRosterControl con = new ClassRosterControl(); + con.run(); } } diff --git a/mod2/Class roster/src/IO/ClassRosterView.java b/mod2/Class roster/src/IO/ClassRosterView.java new file mode 100644 index 0000000..10c5437 --- /dev/null +++ b/mod2/Class roster/src/IO/ClassRosterView.java @@ -0,0 +1,18 @@ +package IO; + +import interfaces.ConsoleIo; + +public class ClassRosterView { + private ConsoleIo io = new Console(); + + public int printMenuAndGetSelection() { + io.print("Main Menu"); + io.print("1. List Student IDs"); + io.print("2. Create New Student"); + io.print("3. View a Student"); + io.print("4. Remove a Student"); + io.print("5. Exit"); + + return io.getInt("Please select from the above choices.", 1, 5); + } +} diff --git a/mod2/Class roster/src/IO/Console.java b/mod2/Class roster/src/IO/Console.java new file mode 100644 index 0000000..b856fe3 --- /dev/null +++ b/mod2/Class roster/src/IO/Console.java @@ -0,0 +1,174 @@ +package IO; + +import java.util.Scanner; + +import interfaces.ConsoleIo; + +public class Console implements ConsoleIo { + private Scanner sc = new Scanner(System.in); + + @Override + public int getInt(String prompt) { + boolean isCorrect = false; + int value = 0; + String userInput; + while (!isCorrect) { + userInput = this.getString(prompt); + try { + value = Integer.parseInt(userInput); + isCorrect = true; + } catch (Exception e) { + this.print("that was not a number please try again"); + } + } + return value; + } + + @Override + public int getInt(String prompt, int min, int max) { + boolean isCorrect = false; + int value; + do { + value = this.getInt(prompt); + if (value > max) { + this.print("that number was to high"); + } else if (value < min) { + this.print("that number was to low"); + } else { + isCorrect = true; + } + } while (!isCorrect); + return value; + } + + @Override + public float getFloat(String prompt) { + boolean isCorrect = false; + float value = 0; + String userInput; + while (!isCorrect) { + userInput = this.getString(prompt); + try { + value = Float.parseFloat(userInput); + isCorrect = true; + } catch (Exception e) { + this.print("that was not a number please try again"); + } + } + return value; + } + + @Override + public float getFloat(String prompt, float min, float max) { + boolean isCorrect = false; + float value; + do { + value = this.getFloat(prompt); + if (value > max) { + this.print("that number was to high"); + } else if (value < min) { + this.print("that number was to low"); + } else { + isCorrect = true; + } + } while (!isCorrect); + return value; + } + + @Override + public double getDouble(String prompt) { + boolean isCorrect = false; + double value = 0; + String userInput; + while (!isCorrect) { + userInput = this.getString(prompt); + try { + value = Double.parseDouble(userInput); + isCorrect = true; + } catch (Exception e) { + this.print("That was not a double. Please try again"); + } + } + return value; + } + + @Override + public double getDouble(String prompt, Double min, Double max) { + boolean isCorrect = false; + double value; + do { + value = this.getDouble(prompt); + if (value > max) { + this.print("that number was to high"); + } else if (value < min) { + this.print("that number was to low"); + } else { + isCorrect = true; + } + } while (!isCorrect); + return value; + } + + @Override + public boolean getboolean(String prompt) { + boolean isCorrect = false; + boolean value = false; + String userInput; + while (!isCorrect) { + userInput = this.getString(prompt); + try { + value = Boolean.parseBoolean(userInput); + isCorrect = true; + } catch (Exception e) { + this.print("That was not a boolean. Please try again"); + } + } + return value; + } + + @Override + public long getLong(String prompt) { + boolean isCorrect = false; + String userInput; + long value = 0; + while (!isCorrect) { + userInput = this.getString(prompt); + try { + value = Long.parseLong(userInput); + isCorrect = true; + } catch (Exception e) { + this.print("That was not a double. Please try again"); + } + } + return value; + } + + + public long getLong(String prompt, long min, long max) { + boolean isCorrect = false; + long value; + do { + value = this.getLong(prompt); + if (value > max) { + this.print("that number was to high"); + } else if (value < min) { + this.print("that number was to low"); + } else { + isCorrect = true; + } + } while (!isCorrect); + return value; + } + + @Override + public String getString(String prompt) { + this.print(prompt); + return this.sc.nextLine(); + } + + @Override + public void print(String msg) { + System.out.println(msg); + + } +} diff --git a/mod2/Class roster/src/controller/ClassRosterControl.java b/mod2/Class roster/src/controller/ClassRosterControl.java new file mode 100644 index 0000000..1d0f88d --- /dev/null +++ b/mod2/Class roster/src/controller/ClassRosterControl.java @@ -0,0 +1,45 @@ +package controller; + +import IO.ClassRosterView; +import IO.Console; +import interfaces.ConsoleIo; + +public class ClassRosterControl { + private ConsoleIo io = new Console(); + ClassRosterView view = new ClassRosterView(); + + public void run() { + boolean keepGoing = true; + int menuSelection = 0; + while (keepGoing) { + + menuSelection = getMenuSelection(); + + switch (menuSelection) { + case 1: + io.print("LIST STUDENTS"); + break; + case 2: + io.print("CREATE STUDENT"); + break; + case 3: + io.print("VIEW STUDENT"); + break; + case 4: + io.print("REMOVE STUDENT"); + break; + case 5: + keepGoing = false; + break; + default: + io.print("UNKNOWN COMMAND"); + } + + } + io.print("GOOD BYE"); + } + + private int getMenuSelection() { + return view.printMenuAndGetSelection(); + } +} diff --git a/mod2/Class roster/src/interfaces/ClassRosterDao.java b/mod2/Class roster/src/interfaces/ClassRosterDao.java new file mode 100644 index 0000000..9291df6 --- /dev/null +++ b/mod2/Class roster/src/interfaces/ClassRosterDao.java @@ -0,0 +1,5 @@ +package interfaces; + +public interface ClassRosterDao { + +} diff --git a/mod2/Class roster/src/interfaces/ConsoleIo.java b/mod2/Class roster/src/interfaces/ConsoleIo.java new file mode 100644 index 0000000..b8268ef --- /dev/null +++ b/mod2/Class roster/src/interfaces/ConsoleIo.java @@ -0,0 +1,16 @@ +package interfaces; + +public interface ConsoleIo { + public void print(String msg); + public int getInt(String prompt); + public int getInt(String prompt, int min, int max); + public float getFloat(String prompt); + public float getFloat(String prompt, float min, float max); + public double getDouble(String prompt); + public double getDouble(String prompt, Double min, Double max); + public boolean getboolean(String prompt); + public String getString(String prompt); + public long getLong(String prompt); + public long getLong(String prompt, long min, long max); + +} diff --git a/mod2/Class roster/src/model/student.java b/mod2/Class roster/src/model/student.java new file mode 100644 index 0000000..714ecd2 --- /dev/null +++ b/mod2/Class roster/src/model/student.java @@ -0,0 +1,5 @@ +package model; + +public class student { + +} diff --git a/mod2/Class roster/src/storage/OutFile.txt b/mod2/Class roster/src/storage/OutFile.txt new file mode 100644 index 0000000..e69de29 diff --git a/mod2/Librairy/src/storage/OutFile.txt b/mod2/Librairy/src/storage/OutFile.txt index c7b0cc3..ab35ce3 100644 --- a/mod2/Librairy/src/storage/OutFile.txt +++ b/mod2/Librairy/src/storage/OutFile.txt @@ -1 +1 @@ -fyfyus::hasgfgdfh::sfgsfg::false::0 \ No newline at end of file +rock::god::hat::false::0 diff --git a/mod2/d&d.vs/src/modle/Person.java b/mod2/d&d.vs/src/modle/Person.java index 32ea353..5587090 100644 --- a/mod2/d&d.vs/src/modle/Person.java +++ b/mod2/d&d.vs/src/modle/Person.java @@ -1,7 +1,11 @@ package modle; -import java.util.List; + +import javax.annotation.processing.RoundEnvironment; public class Person { + private static RoundEnvironment round = new RoundEnvironment() { + + }; private int str; public int getStr() { @@ -82,7 +86,6 @@ public int getWism() { return this.wism; } - private int car; public int getCar() { @@ -99,5 +102,5 @@ public int getCarm() { return this.carm; } - //private List itemList = new List(); + // private List itemList = new List(); } diff --git a/mod2/d&d.vs/src/modle/item.java b/mod2/d&d.vs/src/modle/item.java index b293ce5..2c5b437 100644 --- a/mod2/d&d.vs/src/modle/item.java +++ b/mod2/d&d.vs/src/modle/item.java @@ -1,5 +1,6 @@ package modle; public class item { - + private String name; + private int weight; } From 4b869971284a32ac366ec0fa9d75d9a557b9d522 Mon Sep 17 00:00:00 2001 From: bhimio Date: Wed, 4 May 2022 10:49:39 -0400 Subject: [PATCH 04/12] saving... --- mod2/Class roster/src/IO/ClassRosterView.java | 76 ++++++++++++++++++- mod2/Class roster/src/IO/Console.java | 39 +++++----- .../src/controller/ClassRosterControl.java | 57 ++++++++++++-- .../src/dao/ClassRosterDaoFileImpl.java | 36 +++++++++ .../src/interfaces/ClassRosterDao.java | 47 +++++++++++- .../src/interfaces/ConsoleIo.java | 30 +++++--- mod2/Class roster/src/model/Student.java | 40 ++++++++++ mod2/Class roster/src/model/student.java | 5 -- 8 files changed, 285 insertions(+), 45 deletions(-) create mode 100644 mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java create mode 100644 mod2/Class roster/src/model/Student.java delete mode 100644 mod2/Class roster/src/model/student.java diff --git a/mod2/Class roster/src/IO/ClassRosterView.java b/mod2/Class roster/src/IO/ClassRosterView.java index 10c5437..c5f7641 100644 --- a/mod2/Class roster/src/IO/ClassRosterView.java +++ b/mod2/Class roster/src/IO/ClassRosterView.java @@ -1,6 +1,9 @@ package IO; +import java.util.List; + import interfaces.ConsoleIo; +import model.Student; public class ClassRosterView { private ConsoleIo io = new Console(); @@ -13,6 +16,77 @@ public int printMenuAndGetSelection() { io.print("4. Remove a Student"); io.print("5. Exit"); - return io.getInt("Please select from the above choices.", 1, 5); + return io.readInt("Please select from the above choices.", 1, 5); + } + + public Student getNewStudentInfo() { + String studentId = io.readString("Please enter Student ID"); + String firstName = io.readString("Please enter First Name"); + String lastName = io.readString("Please enter Last Name"); + String cohort = io.readString("Please enter Cohort"); + Student currentStudent = new Student(studentId); + currentStudent.setFirstName(firstName); + currentStudent.setLastName(lastName); + currentStudent.setCohort(cohort); + return currentStudent; + } + + public void displayCreateStudentBanner() { + io.print("=== Create Student ==="); + } + + public void displayCreateSuccessBanner() { + io.readString( + "Student successfully created. Please hit enter to continue"); + } + + public void displayStudentList(List studentList) { + for (Student currentStudent : studentList) { + io.print(currentStudent.getStudentId() + ": " + + currentStudent.getFirstName() + " " + + currentStudent.getLastName()); + } + io.readString("Please hit enter to continue."); + } + + public void displayDisplayAllBanner() { + io.print("=== Display All Students ==="); + } + + public void displayDisplayStudentBanner () { + io.print("=== Display Student ==="); + } + + public String getStudentIdChoice() { + return io.readString("Please enter the Student ID."); + } + + public void displayStudent(Student student) { + if (student != null) { + io.print(student.getStudentId()); + io.print(student.getFirstName() + " " + student.getLastName()); + io.print(student.getCohort()); + io.print(""); + } else { + io.print("No such student."); + } + io.readString("Please hit enter to continue."); + } + + public void displayRemoveStudentBanner () { + io.print("=== Remove Student ==="); + } + + public void displayRemoveSuccessBanner () { + io.readString("Student successfully removed. Please hit enter to continue."); + } + + public void displayExitBanner() { + io.print("Good Bye!!!"); + } + + public void displayUnknownCommandBanner() { + io.print("Unknown Command!!!"); } + } diff --git a/mod2/Class roster/src/IO/Console.java b/mod2/Class roster/src/IO/Console.java index b856fe3..3a7ac0c 100644 --- a/mod2/Class roster/src/IO/Console.java +++ b/mod2/Class roster/src/IO/Console.java @@ -8,12 +8,12 @@ public class Console implements ConsoleIo { private Scanner sc = new Scanner(System.in); @Override - public int getInt(String prompt) { + public int readInt(String prompt) { boolean isCorrect = false; int value = 0; String userInput; while (!isCorrect) { - userInput = this.getString(prompt); + userInput = this.readString(prompt); try { value = Integer.parseInt(userInput); isCorrect = true; @@ -25,11 +25,11 @@ public int getInt(String prompt) { } @Override - public int getInt(String prompt, int min, int max) { + public int readInt(String prompt, int min, int max) { boolean isCorrect = false; int value; do { - value = this.getInt(prompt); + value = this.readInt(prompt); if (value > max) { this.print("that number was to high"); } else if (value < min) { @@ -42,12 +42,12 @@ public int getInt(String prompt, int min, int max) { } @Override - public float getFloat(String prompt) { + public float readFloat(String prompt) { boolean isCorrect = false; float value = 0; String userInput; while (!isCorrect) { - userInput = this.getString(prompt); + userInput = this.readString(prompt); try { value = Float.parseFloat(userInput); isCorrect = true; @@ -59,11 +59,11 @@ public float getFloat(String prompt) { } @Override - public float getFloat(String prompt, float min, float max) { + public float readFloat(String prompt, float min, float max) { boolean isCorrect = false; float value; do { - value = this.getFloat(prompt); + value = this.readFloat(prompt); if (value > max) { this.print("that number was to high"); } else if (value < min) { @@ -76,12 +76,12 @@ public float getFloat(String prompt, float min, float max) { } @Override - public double getDouble(String prompt) { + public double readDouble(String prompt) { boolean isCorrect = false; double value = 0; String userInput; while (!isCorrect) { - userInput = this.getString(prompt); + userInput = this.readString(prompt); try { value = Double.parseDouble(userInput); isCorrect = true; @@ -93,11 +93,11 @@ public double getDouble(String prompt) { } @Override - public double getDouble(String prompt, Double min, Double max) { + public double readDouble(String prompt, Double min, Double max) { boolean isCorrect = false; double value; do { - value = this.getDouble(prompt); + value = this.readDouble(prompt); if (value > max) { this.print("that number was to high"); } else if (value < min) { @@ -110,12 +110,12 @@ public double getDouble(String prompt, Double min, Double max) { } @Override - public boolean getboolean(String prompt) { + public boolean readboolean(String prompt) { boolean isCorrect = false; boolean value = false; String userInput; while (!isCorrect) { - userInput = this.getString(prompt); + userInput = this.readString(prompt); try { value = Boolean.parseBoolean(userInput); isCorrect = true; @@ -127,12 +127,12 @@ public boolean getboolean(String prompt) { } @Override - public long getLong(String prompt) { + public long readLong(String prompt) { boolean isCorrect = false; String userInput; long value = 0; while (!isCorrect) { - userInput = this.getString(prompt); + userInput = this.readString(prompt); try { value = Long.parseLong(userInput); isCorrect = true; @@ -143,12 +143,11 @@ public long getLong(String prompt) { return value; } - - public long getLong(String prompt, long min, long max) { + public long readLong(String prompt, long min, long max) { boolean isCorrect = false; long value; do { - value = this.getLong(prompt); + value = this.readLong(prompt); if (value > max) { this.print("that number was to high"); } else if (value < min) { @@ -161,7 +160,7 @@ public long getLong(String prompt, long min, long max) { } @Override - public String getString(String prompt) { + public String readString(String prompt) { this.print(prompt); return this.sc.nextLine(); } diff --git a/mod2/Class roster/src/controller/ClassRosterControl.java b/mod2/Class roster/src/controller/ClassRosterControl.java index 1d0f88d..c268f89 100644 --- a/mod2/Class roster/src/controller/ClassRosterControl.java +++ b/mod2/Class roster/src/controller/ClassRosterControl.java @@ -1,45 +1,86 @@ package controller; +import java.util.List; + import IO.ClassRosterView; import IO.Console; +import dao.ClassRosterDaoFileImpl; +import interfaces.ClassRosterDao; import interfaces.ConsoleIo; +import model.Student; public class ClassRosterControl { private ConsoleIo io = new Console(); ClassRosterView view = new ClassRosterView(); + ClassRosterDao dao = new ClassRosterDaoFileImpl(); public void run() { boolean keepGoing = true; int menuSelection = 0; while (keepGoing) { - + menuSelection = getMenuSelection(); switch (menuSelection) { case 1: - io.print("LIST STUDENTS"); + listStudents(); break; case 2: - io.print("CREATE STUDENT"); + createStudent(); break; case 3: - io.print("VIEW STUDENT"); + viewStudent(); break; case 4: - io.print("REMOVE STUDENT"); + removeStudent(); break; case 5: keepGoing = false; break; default: - io.print("UNKNOWN COMMAND"); + unknownCommand(); } } - io.print("GOOD BYE"); + exitMessage(); } - + private int getMenuSelection() { return view.printMenuAndGetSelection(); } + + private void createStudent() { + view.displayCreateStudentBanner(); + Student newStudent = view.getNewStudentInfo(); + dao.addStudent(newStudent.getStudentId(), newStudent); + view.displayCreateSuccessBanner(); + } + + private void listStudents() { + view.displayDisplayAllBanner(); + List studentList = dao.getAllStudents(); + view.displayStudentList(studentList); + } + + private void viewStudent() { + view.displayDisplayStudentBanner(); + String studentId = view.getStudentIdChoice(); + Student student = dao.getStudent(studentId); + view.displayStudent(student); + } + + private void removeStudent() { + view.displayRemoveStudentBanner(); + String studentId = view.getStudentIdChoice(); + dao.removeStudent(studentId); + view.displayRemoveSuccessBanner(); + } + + private void unknownCommand() { + view.displayUnknownCommandBanner(); + } + + private void exitMessage() { + view.displayExitBanner(); + } } diff --git a/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java b/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java new file mode 100644 index 0000000..6d26746 --- /dev/null +++ b/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java @@ -0,0 +1,36 @@ +package dao; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import interfaces.ClassRosterDao; +import model.Student; + +public class ClassRosterDaoFileImpl implements ClassRosterDao { + private Map students = new HashMap<>(); + + @Override + public Student addStudent(String studentId, Student student) { + Student newStudent = students.put(studentId, student); + return newStudent; + } + + @Override + public List getAllStudents() { + return new ArrayList(students.values()); + } + + @Override + public Student getStudent(String studentId) { + return students.get(studentId); + } + + @Override + public Student removeStudent(String studentId) { + Student removedStudent = students.remove(studentId); + return removedStudent; + } + +} \ No newline at end of file diff --git a/mod2/Class roster/src/interfaces/ClassRosterDao.java b/mod2/Class roster/src/interfaces/ClassRosterDao.java index 9291df6..5d34a2a 100644 --- a/mod2/Class roster/src/interfaces/ClassRosterDao.java +++ b/mod2/Class roster/src/interfaces/ClassRosterDao.java @@ -1,5 +1,50 @@ package interfaces; +import java.util.List; + +import model.Student; + public interface ClassRosterDao { - + /** + * Adds the given Student to the roster and associates it with the given + * student id. If there is already a student associated with the given + * student id it will return that student object, otherwise it will + * return null. + * + * @param studentId id with which student is to be associated + * @param student student to be added to the roster + * @return the Student object previously associated with the given + * student id if it exists, null otherwise + */ + Student addStudent(String studentId, Student student); + + /** + * Returns a String array containing the student ids of all + * students in the roster. + * + * @return String array containing the ids of all the students + * in the roster + */ + List getAllStudents(); + + /** + * Returns the student object associated with the given student id. + * Returns null if no such student exists + * + * @param studentId ID of the student to retrieve + * @return the Student object associated with the given student id, + * null if no such student exists + */ + Student getStudent(String studentId); + + /** + * Removes from the roster the student associated with the given id. + * Returns the student object that is being removed or null if + * there is no student associated with the given id + * + * @param studentId id of student to be removed + * @return Student object that was removed or null if no student + * was associated with the given student id + */ + Student removeStudent(String studentId); } diff --git a/mod2/Class roster/src/interfaces/ConsoleIo.java b/mod2/Class roster/src/interfaces/ConsoleIo.java index b8268ef..3ea93b2 100644 --- a/mod2/Class roster/src/interfaces/ConsoleIo.java +++ b/mod2/Class roster/src/interfaces/ConsoleIo.java @@ -2,15 +2,25 @@ public interface ConsoleIo { public void print(String msg); - public int getInt(String prompt); - public int getInt(String prompt, int min, int max); - public float getFloat(String prompt); - public float getFloat(String prompt, float min, float max); - public double getDouble(String prompt); - public double getDouble(String prompt, Double min, Double max); - public boolean getboolean(String prompt); - public String getString(String prompt); - public long getLong(String prompt); - public long getLong(String prompt, long min, long max); + + public int readInt(String prompt); + + public int readInt(String prompt, int min, int max); + + public float readFloat(String prompt); + + public float readFloat(String prompt, float min, float max); + + public double readDouble(String prompt); + + public double readDouble(String prompt, Double min, Double max); + + public boolean readboolean(String prompt); + + public String readString(String prompt); + + public long readLong(String prompt); + + public long readLong(String prompt, long min, long max); } diff --git a/mod2/Class roster/src/model/Student.java b/mod2/Class roster/src/model/Student.java new file mode 100644 index 0000000..0ca9adb --- /dev/null +++ b/mod2/Class roster/src/model/Student.java @@ -0,0 +1,40 @@ +package model; + +public class Student { + private String firstName; + private String lastName; + private String studentId; + private String cohort; // Java or .Net + cohort month/year + + public Student(String studentId) { + this.studentId = studentId; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getStudentId() { + return studentId; + } + + public String getCohort() { + return cohort; + } + + public void setCohort(String cohort) { + this.cohort = cohort; + } +} diff --git a/mod2/Class roster/src/model/student.java b/mod2/Class roster/src/model/student.java deleted file mode 100644 index 714ecd2..0000000 --- a/mod2/Class roster/src/model/student.java +++ /dev/null @@ -1,5 +0,0 @@ -package model; - -public class student { - -} From 664e899cbb3d74e8f87fbff7fe548126bdc50c19 Mon Sep 17 00:00:00 2001 From: bhimio Date: Wed, 4 May 2022 14:05:48 -0400 Subject: [PATCH 05/12] saving... roster finished --- mod2/Class roster/roster.txt | 2 + mod2/Class roster/src/App.java | 12 +- mod2/Class roster/src/IO/ClassRosterView.java | 76 ++++++----- .../src/controller/ClassRosterControl.java | 79 ++++++------ .../src/dao/ClassRosterDaoException.java | 13 ++ .../src/dao/ClassRosterDaoFileImpl.java | 118 +++++++++++++++++- .../src/interfaces/ClassRosterDao.java | 13 +- 7 files changed, 233 insertions(+), 80 deletions(-) create mode 100644 mod2/Class roster/roster.txt create mode 100644 mod2/Class roster/src/dao/ClassRosterDaoException.java diff --git a/mod2/Class roster/roster.txt b/mod2/Class roster/roster.txt new file mode 100644 index 0000000..27d94c6 --- /dev/null +++ b/mod2/Class roster/roster.txt @@ -0,0 +1,2 @@ +0002::yaga::baborine::hapy.NET +0001::bhima::raisz::1/2/3/4/5/6/7/8/9/0/ diff --git a/mod2/Class roster/src/App.java b/mod2/Class roster/src/App.java index 1af8874..ad29ed4 100644 --- a/mod2/Class roster/src/App.java +++ b/mod2/Class roster/src/App.java @@ -1,8 +1,16 @@ +import IO.ClassRosterView; +import IO.Console; import controller.ClassRosterControl; +import dao.ClassRosterDaoFileImpl; +import interfaces.ClassRosterDao; +import interfaces.ConsoleIo; public class App { public static void main(String[] args) throws Exception { - ClassRosterControl con = new ClassRosterControl(); - con.run(); + ConsoleIo myIo = new Console(); + ClassRosterView myView = new ClassRosterView(myIo); + ClassRosterDao myDao = new ClassRosterDaoFileImpl(); + ClassRosterControl controller = new ClassRosterControl(myDao, myView); + controller.run(); } } diff --git a/mod2/Class roster/src/IO/ClassRosterView.java b/mod2/Class roster/src/IO/ClassRosterView.java index c5f7641..4476f0d 100644 --- a/mod2/Class roster/src/IO/ClassRosterView.java +++ b/mod2/Class roster/src/IO/ClassRosterView.java @@ -6,7 +6,11 @@ import model.Student; public class ClassRosterView { - private ConsoleIo io = new Console(); + ConsoleIo io; + + public ClassRosterView(ConsoleIo io) { + this.io = io; + } public int printMenuAndGetSelection() { io.print("Main Menu"); @@ -50,43 +54,47 @@ public void displayStudentList(List studentList) { } public void displayDisplayAllBanner() { - io.print("=== Display All Students ==="); - } - - public void displayDisplayStudentBanner () { - io.print("=== Display Student ==="); - } - - public String getStudentIdChoice() { - return io.readString("Please enter the Student ID."); - } - - public void displayStudent(Student student) { - if (student != null) { - io.print(student.getStudentId()); - io.print(student.getFirstName() + " " + student.getLastName()); - io.print(student.getCohort()); - io.print(""); - } else { - io.print("No such student."); - } - io.readString("Please hit enter to continue."); - } - - public void displayRemoveStudentBanner () { - io.print("=== Remove Student ==="); - } - - public void displayRemoveSuccessBanner () { - io.readString("Student successfully removed. Please hit enter to continue."); - } - + io.print("=== Display All Students ==="); + } + + public void displayDisplayStudentBanner() { + io.print("=== Display Student ==="); + } + + public String getStudentIdChoice() { + return io.readString("Please enter the Student ID."); + } + + public void displayStudent(Student student) { + if (student != null) { + io.print(student.getStudentId()); + io.print(student.getFirstName() + " " + student.getLastName()); + io.print(student.getCohort()); + io.print(""); + } else { + io.print("No such student."); + } + io.readString("Please hit enter to continue."); + } + + public void displayRemoveStudentBanner() { + io.print("=== Remove Student ==="); + } + + public void displayRemoveSuccessBanner() { + io.readString("Student successfully removed. Please hit enter to continue."); + } + public void displayExitBanner() { io.print("Good Bye!!!"); } - + public void displayUnknownCommandBanner() { io.print("Unknown Command!!!"); } - + + public void displayErrorMessage(String errorMsg) { + io.print("=== ERROR ==="); + io.print(errorMsg); + } } diff --git a/mod2/Class roster/src/controller/ClassRosterControl.java b/mod2/Class roster/src/controller/ClassRosterControl.java index c268f89..195246c 100644 --- a/mod2/Class roster/src/controller/ClassRosterControl.java +++ b/mod2/Class roster/src/controller/ClassRosterControl.java @@ -3,73 +3,80 @@ import java.util.List; import IO.ClassRosterView; -import IO.Console; -import dao.ClassRosterDaoFileImpl; +import dao.ClassRosterDaoException; import interfaces.ClassRosterDao; -import interfaces.ConsoleIo; import model.Student; public class ClassRosterControl { - private ConsoleIo io = new Console(); - ClassRosterView view = new ClassRosterView(); - ClassRosterDao dao = new ClassRosterDaoFileImpl(); + ClassRosterView view; + ClassRosterDao dao; + ClassRosterDaoException e; + + public ClassRosterControl(ClassRosterDao dao, ClassRosterView view) { + this.dao = dao; + this.view = view; + } public void run() { - boolean keepGoing = true; - int menuSelection = 0; - while (keepGoing) { + boolean keepGoing = true; + int menuSelection = 0; + try { + while (keepGoing) { - menuSelection = getMenuSelection(); + menuSelection = getMenuSelection(); - switch (menuSelection) { - case 1: - listStudents(); - break; - case 2: - createStudent(); - break; - case 3: - viewStudent(); - break; - case 4: - removeStudent(); - break; - case 5: - keepGoing = false; - break; - default: - unknownCommand(); - } + switch (menuSelection) { + case 1: + listStudents(); + break; + case 2: + createStudent(); + break; + case 3: + viewStudent(); + break; + case 4: + removeStudent(); + break; + case 5: + keepGoing = false; + break; + default: + unknownCommand(); + } - } - exitMessage(); - } + } + exitMessage(); + } catch (ClassRosterDaoException e) { + view.displayErrorMessage(e.getMessage()); + } + } private int getMenuSelection() { return view.printMenuAndGetSelection(); } - private void createStudent() { + private void createStudent() throws ClassRosterDaoException { view.displayCreateStudentBanner(); Student newStudent = view.getNewStudentInfo(); dao.addStudent(newStudent.getStudentId(), newStudent); view.displayCreateSuccessBanner(); } - private void listStudents() { + private void listStudents() throws ClassRosterDaoException{ view.displayDisplayAllBanner(); List studentList = dao.getAllStudents(); view.displayStudentList(studentList); } - private void viewStudent() { + private void viewStudent() throws ClassRosterDaoException{ view.displayDisplayStudentBanner(); String studentId = view.getStudentIdChoice(); Student student = dao.getStudent(studentId); view.displayStudent(student); } - private void removeStudent() { + private void removeStudent() throws ClassRosterDaoException { view.displayRemoveStudentBanner(); String studentId = view.getStudentIdChoice(); dao.removeStudent(studentId); diff --git a/mod2/Class roster/src/dao/ClassRosterDaoException.java b/mod2/Class roster/src/dao/ClassRosterDaoException.java new file mode 100644 index 0000000..2e122ec --- /dev/null +++ b/mod2/Class roster/src/dao/ClassRosterDaoException.java @@ -0,0 +1,13 @@ +package dao; + +public class ClassRosterDaoException extends Exception{ + + public ClassRosterDaoException(String message) { + super(message); + } + + public ClassRosterDaoException(String message, Throwable cause) { + super(message, cause); + } + +} \ No newline at end of file diff --git a/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java b/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java index 6d26746..ca65bb3 100644 --- a/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java +++ b/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java @@ -1,36 +1,146 @@ package dao; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Scanner; import interfaces.ClassRosterDao; import model.Student; public class ClassRosterDaoFileImpl implements ClassRosterDao { private Map students = new HashMap<>(); + public static final String ROSTER_FILE = "roster.txt"; + public static final String DELIMITER = "::"; @Override - public Student addStudent(String studentId, Student student) { + public Student addStudent(String studentId, Student student) throws ClassRosterDaoException { Student newStudent = students.put(studentId, student); + writeRoster(); return newStudent; } @Override - public List getAllStudents() { + public List getAllStudents() throws ClassRosterDaoException { + loadRoster(); return new ArrayList(students.values()); } @Override - public Student getStudent(String studentId) { + public Student getStudent(String studentId) throws ClassRosterDaoException { + return students.get(studentId); } @Override - public Student removeStudent(String studentId) { + public Student removeStudent(String studentId) throws ClassRosterDaoException { Student removedStudent = students.remove(studentId); return removedStudent; } + /** + * reads all students from file + * preferably at startup + * + * @throws ClassRosterDaoException if an error occurs wile reading the file + */ + private void loadRoster() throws ClassRosterDaoException { + Scanner scanner; + + try { + // Create Scanner for reading the file + scanner = new Scanner( + new BufferedReader( + new FileReader(ROSTER_FILE))); + } catch (FileNotFoundException e) { + throw new ClassRosterDaoException( + "-_- Could not load roster data into memory.", e); + } + // currentLine holds the most recent line read from the file + String currentLine; + // currentTokens holds each of the parts of the currentLine after it has + // been split on our DELIMITER + // NOTE FOR APPRENTICES: In our case we use :: as our delimiter. If + // currentLine looks like this: + // 1234::Joe::Smith::Java-September2013 + // then currentTokens will be a string array that looks like this: + // + // ___________________________________ + // | | | | | + // |1234|Joe|Smith|Java-September2013| + // | | | | | + // ----------------------------------- + // [0] [1] [2] [3] + String[] currentTokens; + // Go through ROSTER_FILE line by line, decoding each line into a + // Student object. + // Process while we have more lines in the file + while (scanner.hasNextLine()) { + // get the next line in the file + currentLine = scanner.nextLine(); + // break up the line into tokens + currentTokens = currentLine.split(DELIMITER); + // Create a new Student object and put it into the map of students + // NOTE FOR APPRENTICES: We are going to use the student id + // which is currentTokens[0] as the map key for our student object. + // We also have to pass the student id into the Student constructor + Student currentStudent = new Student(currentTokens[0]); + // Set the remaining vlaues on currentStudent manually + currentStudent.setFirstName(currentTokens[1]); + currentStudent.setLastName(currentTokens[2]); + currentStudent.setCohort(currentTokens[3]); + + // Put currentStudent into the map using studentID as the key + students.put(currentStudent.getStudentId(), currentStudent); + } + // close scanner + scanner.close(); + } + + /** + * Writes all students in the roster out to a ROSTER_FILE. See loadRoster + * for file format. + * + * @throws ClassRosterDaoException if an error occurs writing to the file + */ + private void writeRoster() throws ClassRosterDaoException { + // NOTE FOR APPRENTICES: We are not handling the IOException - but + // we are translating it to an application specific exception and + // then simple throwing it (i.e. 'reporting' it) to the code that + // called us. It is the responsibility of the calling code to + // handle any errors that occur. + PrintWriter out; + + try { + out = new PrintWriter(new FileWriter(ROSTER_FILE)); + } catch (IOException e) { + throw new ClassRosterDaoException( + "Could not save student data.", e); + } + + // Write out the Student objects to the roster file. + // NOTE TO THE APPRENTICES: We could just grab the student map, + // get the Collection of Students and iterate over them but we've + // already created a method that gets a List of Students so + // we'll reuse it. + List studentList = this.getAllStudents(); + for (Student currentStudent : studentList) { + // write the Student object to the file + out.println(currentStudent.getStudentId() + DELIMITER + + currentStudent.getFirstName() + DELIMITER + + currentStudent.getLastName() + DELIMITER + + currentStudent.getCohort()); + // force PrintWriter to write line to the file + out.flush(); + } + // Clean up + out.close(); + } } \ No newline at end of file diff --git a/mod2/Class roster/src/interfaces/ClassRosterDao.java b/mod2/Class roster/src/interfaces/ClassRosterDao.java index 5d34a2a..f20a13f 100644 --- a/mod2/Class roster/src/interfaces/ClassRosterDao.java +++ b/mod2/Class roster/src/interfaces/ClassRosterDao.java @@ -2,6 +2,7 @@ import java.util.List; +import dao.ClassRosterDaoException; import model.Student; public interface ClassRosterDao { @@ -15,8 +16,9 @@ public interface ClassRosterDao { * @param student student to be added to the roster * @return the Student object previously associated with the given * student id if it exists, null otherwise + * @throws ClassRosterDaoException */ - Student addStudent(String studentId, Student student); + Student addStudent(String studentId, Student student) throws ClassRosterDaoException; /** * Returns a String array containing the student ids of all @@ -24,8 +26,9 @@ public interface ClassRosterDao { * * @return String array containing the ids of all the students * in the roster + * @throws ClassRosterDaoException */ - List getAllStudents(); + List getAllStudents() throws ClassRosterDaoException; /** * Returns the student object associated with the given student id. @@ -34,8 +37,9 @@ public interface ClassRosterDao { * @param studentId ID of the student to retrieve * @return the Student object associated with the given student id, * null if no such student exists + * @throws ClassRosterDaoException */ - Student getStudent(String studentId); + Student getStudent(String studentId) throws ClassRosterDaoException; /** * Removes from the roster the student associated with the given id. @@ -45,6 +49,7 @@ public interface ClassRosterDao { * @param studentId id of student to be removed * @return Student object that was removed or null if no student * was associated with the given student id + * @throws ClassRosterDaoException */ - Student removeStudent(String studentId); + Student removeStudent(String studentId) throws ClassRosterDaoException; } From d510f1775ea6559a1c38e8e76e0cf635a4e2498b Mon Sep 17 00:00:00 2001 From: bhimio Date: Wed, 4 May 2022 14:06:13 -0400 Subject: [PATCH 06/12] go --- mod2/Class roster/src/storage/OutFile.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 mod2/Class roster/src/storage/OutFile.txt diff --git a/mod2/Class roster/src/storage/OutFile.txt b/mod2/Class roster/src/storage/OutFile.txt deleted file mode 100644 index e69de29..0000000 From f22eb539d97099654821286e92c7b6a725280d14 Mon Sep 17 00:00:00 2001 From: bhimio Date: Tue, 10 May 2022 08:54:05 -0400 Subject: [PATCH 07/12] finished --- mod2/Class roster/src/App.java | 15 +- .../audit/ClassRosterAuditDaoFileImpl.java | 30 +++ .../src/controller/ClassRosterControl.java | 155 ++++++----- .../src/dao/ClassRosterDaoException.java | 13 - .../src/dao/ClassRosterDaoFileImpl.java | 241 +++++++++--------- .../ClassRosterDataValidationException.java | 14 + .../ClassRosterDuplicateIdException.java | 14 + .../ClassRosterPersistenceException.java | 14 + .../src/interfaces/ClassRosterAuditDao.java | 15 ++ .../src/interfaces/ClassRosterDao.java | 108 ++++---- .../interfaces/ClassRosterServiceLayer.java | 64 +++++ .../ClassRosterServiceLayerFileImpl.java | 96 +++++++ mod2/d&d.vs/src/modle/Person.java | 3 - 13 files changed, 535 insertions(+), 247 deletions(-) create mode 100644 mod2/Class roster/src/audit/ClassRosterAuditDaoFileImpl.java delete mode 100644 mod2/Class roster/src/dao/ClassRosterDaoException.java create mode 100644 mod2/Class roster/src/exceptions/ClassRosterDataValidationException.java create mode 100644 mod2/Class roster/src/exceptions/ClassRosterDuplicateIdException.java create mode 100644 mod2/Class roster/src/exceptions/ClassRosterPersistenceException.java create mode 100644 mod2/Class roster/src/interfaces/ClassRosterAuditDao.java create mode 100644 mod2/Class roster/src/interfaces/ClassRosterServiceLayer.java create mode 100644 mod2/Class roster/src/serviceLayer/ClassRosterServiceLayerFileImpl.java diff --git a/mod2/Class roster/src/App.java b/mod2/Class roster/src/App.java index ad29ed4..9cc3420 100644 --- a/mod2/Class roster/src/App.java +++ b/mod2/Class roster/src/App.java @@ -1,16 +1,29 @@ import IO.ClassRosterView; import IO.Console; +import audit.ClassRosterAuditDaoFileImpl; import controller.ClassRosterControl; import dao.ClassRosterDaoFileImpl; +import interfaces.ClassRosterAuditDao; import interfaces.ClassRosterDao; +import interfaces.ClassRosterServiceLayer; import interfaces.ConsoleIo; +import serviceLayer.ClassRosterServiceLayerFileImpl; public class App { public static void main(String[] args) throws Exception { + // Instantiate the UserIO implementation ConsoleIo myIo = new Console(); + // Instantiate the View and wire the UserIO implementation into it ClassRosterView myView = new ClassRosterView(myIo); + // Instantiate the DAO ClassRosterDao myDao = new ClassRosterDaoFileImpl(); - ClassRosterControl controller = new ClassRosterControl(myDao, myView); + // Instantiate the Audit DAO + ClassRosterAuditDao myAuditDao = new ClassRosterAuditDaoFileImpl(); + // Instantiate the Service Layer and wire the DAO and Audit DAO into it + ClassRosterServiceLayer myService = new ClassRosterServiceLayerFileImpl(myDao, myAuditDao); + // Instantiate the Controller and wire the Service Layer into it + ClassRosterControl controller = new ClassRosterControl(myService, myView); + // Kick off the Controller controller.run(); } } diff --git a/mod2/Class roster/src/audit/ClassRosterAuditDaoFileImpl.java b/mod2/Class roster/src/audit/ClassRosterAuditDaoFileImpl.java new file mode 100644 index 0000000..00dccfb --- /dev/null +++ b/mod2/Class roster/src/audit/ClassRosterAuditDaoFileImpl.java @@ -0,0 +1,30 @@ +package audit; + +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.time.LocalDateTime; + +import exceptions.ClassRosterPersistenceException; +import interfaces.ClassRosterAuditDao; + +public class ClassRosterAuditDaoFileImpl implements ClassRosterAuditDao { + + public static final String AUDIT_FILE = "audit.txt"; + + @Override + public void writeAuditEntry(String entry) throws ClassRosterPersistenceException { + PrintWriter out; + + try { + out = new PrintWriter(new FileWriter(AUDIT_FILE, true)); + } catch (IOException e) { + throw new ClassRosterPersistenceException("Could not persist audit information.", e); + } + + LocalDateTime timestamp = LocalDateTime.now(); + out.println(timestamp.toString() + " : " + entry); + out.flush(); + } + +} diff --git a/mod2/Class roster/src/controller/ClassRosterControl.java b/mod2/Class roster/src/controller/ClassRosterControl.java index 195246c..61dabde 100644 --- a/mod2/Class roster/src/controller/ClassRosterControl.java +++ b/mod2/Class roster/src/controller/ClassRosterControl.java @@ -3,91 +3,108 @@ import java.util.List; import IO.ClassRosterView; -import dao.ClassRosterDaoException; -import interfaces.ClassRosterDao; +import exceptions.ClassRosterDataValidationException; +import exceptions.ClassRosterDuplicateIdException; +import exceptions.ClassRosterPersistenceException; +import interfaces.ClassRosterServiceLayer; import model.Student; public class ClassRosterControl { - ClassRosterView view; - ClassRosterDao dao; - ClassRosterDaoException e; + private ClassRosterView view; + private ClassRosterServiceLayer service; + ClassRosterPersistenceException e; - public ClassRosterControl(ClassRosterDao dao, ClassRosterView view) { - this.dao = dao; - this.view = view; - } + public ClassRosterControl(ClassRosterServiceLayer service, ClassRosterView view) { + this.service = service; + this.view = view; + } + + /** + * runs program + */ + public void run() { + boolean keepGoing = true; + int menuSelection = 0; + try { + this.service.run(); + while (keepGoing) { - public void run() { - boolean keepGoing = true; - int menuSelection = 0; - try { - while (keepGoing) { + menuSelection = getMenuSelection(); - menuSelection = getMenuSelection(); + switch (menuSelection) { + case 1: + listStudents(); + break; + case 2: + createStudent(); + break; + case 3: + viewStudent(); + break; + case 4: + removeStudent(); + break; + case 5: + keepGoing = false; + service.stopProgram(); + break; + default: + unknownCommand(); + } - switch (menuSelection) { - case 1: - listStudents(); - break; - case 2: - createStudent(); - break; - case 3: - viewStudent(); - break; - case 4: - removeStudent(); - break; - case 5: - keepGoing = false; - break; - default: - unknownCommand(); - } + } + exitMessage(); + } catch (ClassRosterPersistenceException | ClassRosterDataValidationException | ClassRosterDuplicateIdException e) { + view.displayErrorMessage(e.getMessage()); + } + } - } - exitMessage(); - } catch (ClassRosterDaoException e) { - view.displayErrorMessage(e.getMessage()); - } + private int getMenuSelection() { + return view.printMenuAndGetSelection(); } - private int getMenuSelection() { - return view.printMenuAndGetSelection(); - } + private void createStudent() throws ClassRosterPersistenceException, ClassRosterDataValidationException, + ClassRosterDuplicateIdException { + view.displayCreateStudentBanner(); + boolean hasErrors = false; + do { + Student currentStudent = view.getNewStudentInfo(); + try { + service.createStudent(currentStudent); + view.displayCreateSuccessBanner(); + hasErrors = false; + } catch (ClassRosterDuplicateIdException | ClassRosterDataValidationException e) { + hasErrors = true; + view.displayErrorMessage(e.getMessage()); + } + } while (hasErrors); + } - private void createStudent() throws ClassRosterDaoException { - view.displayCreateStudentBanner(); - Student newStudent = view.getNewStudentInfo(); - dao.addStudent(newStudent.getStudentId(), newStudent); - view.displayCreateSuccessBanner(); - } + private void listStudents() throws ClassRosterPersistenceException { + view.displayDisplayAllBanner(); + List studentList = service.getAllStudents(); + view.displayStudentList(studentList); + } - private void listStudents() throws ClassRosterDaoException{ - view.displayDisplayAllBanner(); - List studentList = dao.getAllStudents(); - view.displayStudentList(studentList); + private void viewStudent() throws ClassRosterPersistenceException { + view.displayDisplayStudentBanner(); + String studentId = view.getStudentIdChoice(); + Student student = service.getStudent(studentId); + view.displayStudent(student); } - private void viewStudent() throws ClassRosterDaoException{ - view.displayDisplayStudentBanner(); - String studentId = view.getStudentIdChoice(); - Student student = dao.getStudent(studentId); - view.displayStudent(student); + private void removeStudent() throws ClassRosterPersistenceException { + view.displayRemoveStudentBanner(); + String studentId = view.getStudentIdChoice(); + service.removeStudent(studentId); + view.displayRemoveSuccessBanner(); } - private void removeStudent() throws ClassRosterDaoException { - view.displayRemoveStudentBanner(); - String studentId = view.getStudentIdChoice(); - dao.removeStudent(studentId); - view.displayRemoveSuccessBanner(); + private void unknownCommand() { + view.displayUnknownCommandBanner(); } - private void unknownCommand() { - view.displayUnknownCommandBanner(); - } - - private void exitMessage() { - view.displayExitBanner(); - } + private void exitMessage() { + view.displayExitBanner(); + } } diff --git a/mod2/Class roster/src/dao/ClassRosterDaoException.java b/mod2/Class roster/src/dao/ClassRosterDaoException.java deleted file mode 100644 index 2e122ec..0000000 --- a/mod2/Class roster/src/dao/ClassRosterDaoException.java +++ /dev/null @@ -1,13 +0,0 @@ -package dao; - -public class ClassRosterDaoException extends Exception{ - - public ClassRosterDaoException(String message) { - super(message); - } - - public ClassRosterDaoException(String message, Throwable cause) { - super(message, cause); - } - -} \ No newline at end of file diff --git a/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java b/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java index ca65bb3..1b56e03 100644 --- a/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java +++ b/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java @@ -12,135 +12,148 @@ import java.util.Map; import java.util.Scanner; +import exceptions.ClassRosterPersistenceException; import interfaces.ClassRosterDao; import model.Student; public class ClassRosterDaoFileImpl implements ClassRosterDao { - private Map students = new HashMap<>(); - public static final String ROSTER_FILE = "roster.txt"; + private Map students = new HashMap<>(); + public static final String ROSTER_FILE = "roster.txt"; public static final String DELIMITER = "::"; - @Override - public Student addStudent(String studentId, Student student) throws ClassRosterDaoException { - Student newStudent = students.put(studentId, student); - writeRoster(); - return newStudent; - } + @Override + public Student addStudent(String studentId, Student student) throws ClassRosterPersistenceException { + Student newStudent = students.put(studentId, student); + writeRoster(); + return newStudent; + } + + @Override + public List getAllStudents() throws ClassRosterPersistenceException { + loadRoster(); + return new ArrayList(students.values()); + } + + @Override + public Student getStudent(String studentId) throws ClassRosterPersistenceException { - @Override - public List getAllStudents() throws ClassRosterDaoException { - loadRoster(); - return new ArrayList(students.values()); - } + return students.get(studentId); + } + + @Override + public Student removeStudent(String studentId) throws ClassRosterPersistenceException { + Student removedStudent = students.remove(studentId); + return removedStudent; + } - @Override - public Student getStudent(String studentId) throws ClassRosterDaoException { + @Override + public void run() throws ClassRosterPersistenceException { + this.loadRoster(); + } - return students.get(studentId); + @Override + public void stopProgram() throws ClassRosterPersistenceException { + this.writeRoster(); } - @Override - public Student removeStudent(String studentId) throws ClassRosterDaoException { - Student removedStudent = students.remove(studentId); - return removedStudent; + /** + * reads all students from file + * preferably at startup + * + * @throws ClassRosterPersistenceException if an error occurs wile reading the + * file + */ + private void loadRoster() throws ClassRosterPersistenceException { + Scanner scanner; + + try { + // Create Scanner for reading the file + scanner = new Scanner( + new BufferedReader( + new FileReader(ROSTER_FILE))); + } catch (FileNotFoundException e) { + throw new ClassRosterPersistenceException( + "-_- Could not load roster data into memory.", e); + } + // currentLine holds the most recent line read from the file + String currentLine; + // currentTokens holds each of the parts of the currentLine after it has + // been split on our DELIMITER + // NOTE FOR APPRENTICES: In our case we use :: as our delimiter. If + // currentLine looks like this: + // 1234::Joe::Smith::Java-September2013 + // then currentTokens will be a string array that looks like this: + // + // ___________________________________ + // | | | | | + // |1234|Joe|Smith|Java-September2013| + // | | | | | + // ----------------------------------- + // [0] [1] [2] [3] + String[] currentTokens; + // Go through ROSTER_FILE line by line, decoding each line into a + // Student object. + // Process while we have more lines in the file + while (scanner.hasNextLine()) { + // get the next line in the file + currentLine = scanner.nextLine(); + // break up the line into tokens + currentTokens = currentLine.split(DELIMITER); + // Create a new Student object and put it into the map of students + // NOTE FOR APPRENTICES: We are going to use the student id + // which is currentTokens[0] as the map key for our student object. + // We also have to pass the student id into the Student constructor + Student currentStudent = new Student(currentTokens[0]); + // Set the remaining vlaues on currentStudent manually + currentStudent.setFirstName(currentTokens[1]); + currentStudent.setLastName(currentTokens[2]); + currentStudent.setCohort(currentTokens[3]); + + // Put currentStudent into the map using studentID as the key + students.put(currentStudent.getStudentId(), currentStudent); + } + // close scanner + scanner.close(); } - /** - * reads all students from file - * preferably at startup - * - * @throws ClassRosterDaoException if an error occurs wile reading the file - */ - private void loadRoster() throws ClassRosterDaoException { - Scanner scanner; - - try { - // Create Scanner for reading the file - scanner = new Scanner( - new BufferedReader( - new FileReader(ROSTER_FILE))); - } catch (FileNotFoundException e) { - throw new ClassRosterDaoException( - "-_- Could not load roster data into memory.", e); - } - // currentLine holds the most recent line read from the file - String currentLine; - // currentTokens holds each of the parts of the currentLine after it has - // been split on our DELIMITER - // NOTE FOR APPRENTICES: In our case we use :: as our delimiter. If - // currentLine looks like this: - // 1234::Joe::Smith::Java-September2013 - // then currentTokens will be a string array that looks like this: - // - // ___________________________________ - // | | | | | - // |1234|Joe|Smith|Java-September2013| - // | | | | | - // ----------------------------------- - // [0] [1] [2] [3] - String[] currentTokens; - // Go through ROSTER_FILE line by line, decoding each line into a - // Student object. - // Process while we have more lines in the file - while (scanner.hasNextLine()) { - // get the next line in the file - currentLine = scanner.nextLine(); - // break up the line into tokens - currentTokens = currentLine.split(DELIMITER); - // Create a new Student object and put it into the map of students - // NOTE FOR APPRENTICES: We are going to use the student id - // which is currentTokens[0] as the map key for our student object. - // We also have to pass the student id into the Student constructor - Student currentStudent = new Student(currentTokens[0]); - // Set the remaining vlaues on currentStudent manually - currentStudent.setFirstName(currentTokens[1]); - currentStudent.setLastName(currentTokens[2]); - currentStudent.setCohort(currentTokens[3]); - - // Put currentStudent into the map using studentID as the key - students.put(currentStudent.getStudentId(), currentStudent); - } - // close scanner - scanner.close(); - } - - /** - * Writes all students in the roster out to a ROSTER_FILE. See loadRoster + /** + * Writes all students in the roster out to a ROSTER_FILE. See loadRoster * for file format. * - * @throws ClassRosterDaoException if an error occurs writing to the file + * @throws ClassRosterPersistenceException if an error occurs writing to the + * file */ - private void writeRoster() throws ClassRosterDaoException { - // NOTE FOR APPRENTICES: We are not handling the IOException - but - // we are translating it to an application specific exception and - // then simple throwing it (i.e. 'reporting' it) to the code that - // called us. It is the responsibility of the calling code to - // handle any errors that occur. - PrintWriter out; - - try { - out = new PrintWriter(new FileWriter(ROSTER_FILE)); - } catch (IOException e) { - throw new ClassRosterDaoException( - "Could not save student data.", e); - } - - // Write out the Student objects to the roster file. - // NOTE TO THE APPRENTICES: We could just grab the student map, - // get the Collection of Students and iterate over them but we've - // already created a method that gets a List of Students so - // we'll reuse it. - List studentList = this.getAllStudents(); - for (Student currentStudent : studentList) { - // write the Student object to the file - out.println(currentStudent.getStudentId() + DELIMITER - + currentStudent.getFirstName() + DELIMITER - + currentStudent.getLastName() + DELIMITER - + currentStudent.getCohort()); - // force PrintWriter to write line to the file - out.flush(); - } - // Clean up - out.close(); + private void writeRoster() throws ClassRosterPersistenceException { + // NOTE FOR APPRENTICES: We are not handling the IOException - but + // we are translating it to an application specific exception and + // then simple throwing it (i.e. 'reporting' it) to the code that + // called us. It is the responsibility of the calling code to + // handle any errors that occur. + PrintWriter out; + + try { + out = new PrintWriter(new FileWriter(ROSTER_FILE)); + } catch (IOException e) { + throw new ClassRosterPersistenceException( + "Could not save student data.", e); + } + + // Write out the Student objects to the roster file. + // NOTE TO THE APPRENTICES: We could just grab the student map, + // get the Collection of Students and iterate over them but we've + // already created a method that gets a List of Students so + // we'll reuse it. + List studentList = this.getAllStudents(); + for (Student currentStudent : studentList) { + // write the Student object to the file + out.println(currentStudent.getStudentId() + DELIMITER + + currentStudent.getFirstName() + DELIMITER + + currentStudent.getLastName() + DELIMITER + + currentStudent.getCohort()); + // force PrintWriter to write line to the file + out.flush(); + } + // Clean up + out.close(); } } \ No newline at end of file diff --git a/mod2/Class roster/src/exceptions/ClassRosterDataValidationException.java b/mod2/Class roster/src/exceptions/ClassRosterDataValidationException.java new file mode 100644 index 0000000..cdbd42b --- /dev/null +++ b/mod2/Class roster/src/exceptions/ClassRosterDataValidationException.java @@ -0,0 +1,14 @@ +package exceptions; + +public class ClassRosterDataValidationException extends Exception { + + public ClassRosterDataValidationException(String message) { + super(message); + } + + public ClassRosterDataValidationException(String message, + Throwable cause) { + super(message, cause); + } + +} diff --git a/mod2/Class roster/src/exceptions/ClassRosterDuplicateIdException.java b/mod2/Class roster/src/exceptions/ClassRosterDuplicateIdException.java new file mode 100644 index 0000000..2c4276d --- /dev/null +++ b/mod2/Class roster/src/exceptions/ClassRosterDuplicateIdException.java @@ -0,0 +1,14 @@ +package exceptions; + +public class ClassRosterDuplicateIdException extends Exception { + + public ClassRosterDuplicateIdException(String message) { + super(message); + } + + public ClassRosterDuplicateIdException(String message, + Throwable cause) { + super(message, cause); + } + +} diff --git a/mod2/Class roster/src/exceptions/ClassRosterPersistenceException.java b/mod2/Class roster/src/exceptions/ClassRosterPersistenceException.java new file mode 100644 index 0000000..b9ae706 --- /dev/null +++ b/mod2/Class roster/src/exceptions/ClassRosterPersistenceException.java @@ -0,0 +1,14 @@ +package exceptions; + +public class ClassRosterPersistenceException extends Exception{ + + public ClassRosterPersistenceException(String message) { + super(message); + } + + public ClassRosterPersistenceException(String message, + Throwable cause) { + super(message, cause); + } + +} diff --git a/mod2/Class roster/src/interfaces/ClassRosterAuditDao.java b/mod2/Class roster/src/interfaces/ClassRosterAuditDao.java new file mode 100644 index 0000000..b6d13f6 --- /dev/null +++ b/mod2/Class roster/src/interfaces/ClassRosterAuditDao.java @@ -0,0 +1,15 @@ +package interfaces; + +import exceptions.ClassRosterPersistenceException; + +public interface ClassRosterAuditDao { + + /** + * writes a Audit + * + * @param entry + * @throws ClassRosterPersistenceException + */ + void writeAuditEntry(String entry) throws ClassRosterPersistenceException; + +} diff --git a/mod2/Class roster/src/interfaces/ClassRosterDao.java b/mod2/Class roster/src/interfaces/ClassRosterDao.java index f20a13f..91b063b 100644 --- a/mod2/Class roster/src/interfaces/ClassRosterDao.java +++ b/mod2/Class roster/src/interfaces/ClassRosterDao.java @@ -2,54 +2,68 @@ import java.util.List; -import dao.ClassRosterDaoException; +import exceptions.ClassRosterPersistenceException; import model.Student; public interface ClassRosterDao { - /** - * Adds the given Student to the roster and associates it with the given - * student id. If there is already a student associated with the given - * student id it will return that student object, otherwise it will - * return null. - * - * @param studentId id with which student is to be associated - * @param student student to be added to the roster - * @return the Student object previously associated with the given - * student id if it exists, null otherwise - * @throws ClassRosterDaoException - */ - Student addStudent(String studentId, Student student) throws ClassRosterDaoException; - - /** - * Returns a String array containing the student ids of all - * students in the roster. - * - * @return String array containing the ids of all the students - * in the roster - * @throws ClassRosterDaoException - */ - List getAllStudents() throws ClassRosterDaoException; - - /** - * Returns the student object associated with the given student id. - * Returns null if no such student exists - * - * @param studentId ID of the student to retrieve - * @return the Student object associated with the given student id, - * null if no such student exists - * @throws ClassRosterDaoException - */ - Student getStudent(String studentId) throws ClassRosterDaoException; - - /** - * Removes from the roster the student associated with the given id. - * Returns the student object that is being removed or null if - * there is no student associated with the given id - * - * @param studentId id of student to be removed - * @return Student object that was removed or null if no student - * was associated with the given student id - * @throws ClassRosterDaoException - */ - Student removeStudent(String studentId) throws ClassRosterDaoException; + /** + * Adds the given Student to the roster and associates it with the given + * student id. If there is already a student associated with the given + * student id it will return that student object, otherwise it will + * return null. + * + * @param studentId id with which student is to be associated + * @param student student to be added to the roster + * @return the Student object previously associated with the given + * student id if it exists, null otherwise + * @throws ClassRosterPersistenceException + */ + Student addStudent(String studentId, Student student) throws ClassRosterPersistenceException; + + /** + * Returns a String array containing the student ids of all + * students in the roster. + * + * @return String array containing the ids of all the students + * in the roster + * @throws ClassRosterPersistenceException + */ + List getAllStudents() throws ClassRosterPersistenceException; + + /** + * Returns the student object associated with the given student id. + * Returns null if no such student exists + * + * @param studentId ID of the student to retrieve + * @return the Student object associated with the given student id, + * null if no such student exists + * @throws ClassRosterPersistenceException + */ + Student getStudent(String studentId) throws ClassRosterPersistenceException; + + /** + * Removes from the roster the student associated with the given id. + * Returns the student object that is being removed or null if + * there is no student associated with the given id + * + * @param studentId id of student to be removed + * @return Student object that was removed or null if no student + * was associated with the given student id + * @throws ClassRosterPersistenceException + */ + Student removeStudent(String studentId) throws ClassRosterPersistenceException; + + /** + * insantiates all the students + * + * @throws ClassRosterPersistenceException + */ + void run() throws ClassRosterPersistenceException; + + /** + * writes all students to file + * + * @throws ClassRosterPersistenceException + */ + void stopProgram() throws ClassRosterPersistenceException; } diff --git a/mod2/Class roster/src/interfaces/ClassRosterServiceLayer.java b/mod2/Class roster/src/interfaces/ClassRosterServiceLayer.java new file mode 100644 index 0000000..4f38e77 --- /dev/null +++ b/mod2/Class roster/src/interfaces/ClassRosterServiceLayer.java @@ -0,0 +1,64 @@ +package interfaces; + +import java.util.List; + +import exceptions.ClassRosterDataValidationException; +import exceptions.ClassRosterDuplicateIdException; +import exceptions.ClassRosterPersistenceException; +import model.Student; + +public interface ClassRosterServiceLayer { + + /** + * creates a student but also thows an Exeption if the students id matches + * another id + * + * @param student + * @throws ClassRosterDuplicateIdException + * @throws ClassRosterDataValidationException + * @throws ClassRosterPersistenceException + */ + void createStudent(Student student) throws ClassRosterDuplicateIdException, + ClassRosterDataValidationException, + ClassRosterPersistenceException; + + /** + * gets all students in the student librairy while also checking the Scanner + * + * @return all students as a list + * @throws ClassRosterPersistenceException + */ + List getAllStudents() throws ClassRosterPersistenceException; + + /** + * gets a student by searching it by id + * + * @param studentId + * @return searched student + * @throws ClassRosterPersistenceException + */ + Student getStudent(String studentId) throws ClassRosterPersistenceException; + + /** + * gets a student and then removes it + * + * @param studentId + * @return deleted student + * @throws ClassRosterPersistenceException + */ + Student removeStudent(String studentId) throws ClassRosterPersistenceException; + + /** + * instantiates all students at run time and then writes to an audit + * + * @throws ClassRosterPersistenceException + */ + void run() throws ClassRosterPersistenceException; + + /** + * writes to file and then writes to audit + * + * @throws ClassRosterPersistenceException + */ + void stopProgram() throws ClassRosterPersistenceException; +} diff --git a/mod2/Class roster/src/serviceLayer/ClassRosterServiceLayerFileImpl.java b/mod2/Class roster/src/serviceLayer/ClassRosterServiceLayerFileImpl.java new file mode 100644 index 0000000..82f1df8 --- /dev/null +++ b/mod2/Class roster/src/serviceLayer/ClassRosterServiceLayerFileImpl.java @@ -0,0 +1,96 @@ +package serviceLayer; + +import java.util.List; + +import exceptions.ClassRosterDataValidationException; +import exceptions.ClassRosterDuplicateIdException; +import exceptions.ClassRosterPersistenceException; +import interfaces.ClassRosterAuditDao; +import interfaces.ClassRosterDao; +import interfaces.ClassRosterServiceLayer; +import model.Student; + +public class ClassRosterServiceLayerFileImpl implements ClassRosterServiceLayer { + + private ClassRosterAuditDao auditDao; + + private ClassRosterDao dao; + + public ClassRosterServiceLayerFileImpl(ClassRosterDao dao, ClassRosterAuditDao auditDao) { + this.dao = dao; + this.auditDao = auditDao; + } + + private void validateStudentData(Student student) throws ClassRosterDataValidationException { + + if (student.getFirstName() == null + || student.getFirstName().trim().length() == 0 + || student.getLastName() == null + || student.getLastName().trim().length() == 0 + || student.getCohort() == null + || student.getCohort().trim().length() == 0) { + + throw new ClassRosterDataValidationException( + "ERROR: All fields [First Name, Last Name, Cohort] are required."); + } + } + + @Override + public void createStudent(Student student) throws ClassRosterDataValidationException, + ClassRosterPersistenceException, ClassRosterDuplicateIdException { + + // First check to see if there is alreay a student + // associated with the given student's id + // If so, we're all done here - + // throw a ClassRosterDuplicateIdException + if (dao.getStudent(student.getStudentId()) != null) { + throw new ClassRosterDuplicateIdException( + "ERROR: Could not create student. Student Id " + + student.getStudentId() + + " already exists"); + } + + // Now validate all the fields on the given Student object. + // This method will throw an + // exception if any of the validation rules are violated. + validateStudentData(student); + + // We passed all our business rules checks so go ahead + // and persist the Student object + dao.addStudent(student.getStudentId(), student); + + // The student was successfully created, now write to the audit log + auditDao.writeAuditEntry( + "Student " + student.getStudentId() + " CREATED."); + } + + @Override + public List getAllStudents() throws ClassRosterPersistenceException { + return dao.getAllStudents(); + } + + @Override + public Student getStudent(String studentId) throws ClassRosterPersistenceException { + return dao.getStudent(studentId); + } + + @Override + public Student removeStudent(String studentId) throws ClassRosterPersistenceException { + Student removedStudent = dao.removeStudent(studentId); + // Write to audit log + auditDao.writeAuditEntry("Student " + studentId + " REMOVED."); + return removedStudent; + } + + @Override + public void run() throws ClassRosterPersistenceException { + dao.run(); + auditDao.writeAuditEntry("||||||||||||||| Sucesfull: start runing program |||||||||||||||"); + } + + @Override + public void stopProgram() throws ClassRosterPersistenceException { + dao.stopProgram(); + auditDao.writeAuditEntry("||||||||||||||| Sucesfull: stop program |||||||||||||||"); + } +} diff --git a/mod2/d&d.vs/src/modle/Person.java b/mod2/d&d.vs/src/modle/Person.java index 5587090..d1cdf69 100644 --- a/mod2/d&d.vs/src/modle/Person.java +++ b/mod2/d&d.vs/src/modle/Person.java @@ -3,9 +3,6 @@ import javax.annotation.processing.RoundEnvironment; public class Person { - private static RoundEnvironment round = new RoundEnvironment() { - - }; private int str; public int getStr() { From 1f6c47357b41cf5e5f634c5d2cbd531aaa8478a0 Mon Sep 17 00:00:00 2001 From: bhimio Date: Wed, 11 May 2022 10:40:01 -0400 Subject: [PATCH 08/12] finall commit for class roster branch --- mod2/Class roster/Class roster.jar | Bin 0 -> 16008 bytes mod2/Class roster/audit.txt | 11 ++ mod2/Class roster/roster.txt | 3 +- .../src/dao/ClassRosterDaoFileImpl.java | 1 + .../ClassRosterServiceLayerFileImpl.java | 1 + mod2/adress Book/adress Book.jar | Bin 0 -> 6277 bytes mod2/adress Book/src/App.java | 5 + mod2/adress Book/src/IO/IO.java | 173 ++++++++++++++++++ .../exceptions/DataVialationException.java | 11 ++ .../src/exceptions/PersistenceException.java | 11 ++ .../src/exceptions/SameAdressException.java | 11 ++ mod2/adress Book/src/interfaces/Audit.java | 5 + mod2/adress Book/src/interfaces/Dao.java | 58 ++++++ .../src/interfaces/ServiceLayer.java | 5 + .../adress Book/src/interfaces/consoleIO.java | 50 +++++ mod2/adress Book/src/modle/Adress.java | 38 ++++ 16 files changed, 381 insertions(+), 2 deletions(-) create mode 100644 mod2/Class roster/Class roster.jar create mode 100644 mod2/Class roster/audit.txt create mode 100644 mod2/adress Book/adress Book.jar create mode 100644 mod2/adress Book/src/App.java create mode 100644 mod2/adress Book/src/IO/IO.java create mode 100644 mod2/adress Book/src/exceptions/DataVialationException.java create mode 100644 mod2/adress Book/src/exceptions/PersistenceException.java create mode 100644 mod2/adress Book/src/exceptions/SameAdressException.java create mode 100644 mod2/adress Book/src/interfaces/Audit.java create mode 100644 mod2/adress Book/src/interfaces/Dao.java create mode 100644 mod2/adress Book/src/interfaces/ServiceLayer.java create mode 100644 mod2/adress Book/src/interfaces/consoleIO.java create mode 100644 mod2/adress Book/src/modle/Adress.java diff --git a/mod2/Class roster/Class roster.jar b/mod2/Class roster/Class roster.jar new file mode 100644 index 0000000000000000000000000000000000000000..f7fcf3b977f6a6e34d14fad8e9e05cb9a850e9b6 GIT binary patch literal 16008 zcmbWe1yG$!(mzbF;O-FI-GjRXcXxMp3l72E9fAaRcPF^JdvFcT2YYun{&%F|2K$OAHN7I*f==QrF5_Q%F;Ab4{!R@W&i`W>wTM1k!LrO1UL)huj<2i5U?!qx9_R06K5a+kSD_^+m={t zPdX~&TbiG14^0n&KY!KZ!CmEhR2irHv^FDY6I0NhTgXw#CRD%!qJb`G{u-6uc^hs`VHv9zsR!EIM1|dY!*MPE z!d{yM*-=QFwX#dEuTny#uIrkr$>MCL)?|o0s}6XE-QV#OxmLM7F~NYLrgkU90}GUT zU5x7mVR9E13esXW&nI7ixmkDK_kHKK!q+mC#CvhifRk-JZV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rwyA;P%~V~{@EO2e>2Ow zJNMF=eFjk-Ld~h7`Mq-(jZ}rgon_FwyC0V=ceD?6?;f0})^Xq-_pXAEwqLJM{UWZvI=pd0zb;h$o!hr1YOf{U zzi8`)x4##B|B30>$m$op6#f6VsO@*Y-`3c?mbLvN-T(G^!}@>H;op7dpBQdY z^52See&^=xvFU5M&M!hk`K{v{mVPVV`4cC~`LH-+%^LMu1A|S7r&o5&5 zz2h6U{-g4Lr5%4C@oj$pik$o+Zi?Snc{AdFag@Ig_BH{1g#><4)ypO1{|!*RjcETj zi*Hl0*W~pVX;J?^>hG!SpH}^M^HN0fD~mc@kTgr*YodI4&+~d8w~&rAnWC6{NwA0{~u}KonQa} literal 0 HcmV?d00001 diff --git a/mod2/Class roster/audit.txt b/mod2/Class roster/audit.txt new file mode 100644 index 0000000..1c3a22a --- /dev/null +++ b/mod2/Class roster/audit.txt @@ -0,0 +1,11 @@ +2022-05-09T20:00:54.681710 : Student 1111 CREATED. +2022-05-10T08:32:30.927770 : ||||||||||||||| Sucesfull: start runing program ||||||||||||||| +2022-05-10T08:32:54.832127 : Student 1111 REMOVED. +2022-05-10T08:47:44.467095 : ||||||||||||||| Sucesfull: start runing program ||||||||||||||| +2022-05-10T08:48:25.732196 : Student 1111 REMOVED. +2022-05-10T08:49:19.643601 : Student 1112 CREATED. +2022-05-10T08:49:26.906286 : Student 1111 REMOVED. +2022-05-10T08:49:37.850037 : ||||||||||||||| Sucesfull: stop program ||||||||||||||| +2022-05-11T10:36:21.716903 : ||||||||||||||| Sucesfull: start runing program ||||||||||||||| +2022-05-11T10:36:34.449032 : Student 1111 REMOVED. +2022-05-11T10:36:43.859600 : ||||||||||||||| Sucesfull: stop program ||||||||||||||| diff --git a/mod2/Class roster/roster.txt b/mod2/Class roster/roster.txt index 27d94c6..33f6905 100644 --- a/mod2/Class roster/roster.txt +++ b/mod2/Class roster/roster.txt @@ -1,2 +1 @@ -0002::yaga::baborine::hapy.NET -0001::bhima::raisz::1/2/3/4/5/6/7/8/9/0/ +1112::bhima::raisz::java 2021-2025 diff --git a/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java b/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java index 1b56e03..e304f63 100644 --- a/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java +++ b/mod2/Class roster/src/dao/ClassRosterDaoFileImpl.java @@ -43,6 +43,7 @@ public Student getStudent(String studentId) throws ClassRosterPersistenceExcepti @Override public Student removeStudent(String studentId) throws ClassRosterPersistenceException { Student removedStudent = students.remove(studentId); + this.writeRoster(); return removedStudent; } diff --git a/mod2/Class roster/src/serviceLayer/ClassRosterServiceLayerFileImpl.java b/mod2/Class roster/src/serviceLayer/ClassRosterServiceLayerFileImpl.java index 82f1df8..70ebe14 100644 --- a/mod2/Class roster/src/serviceLayer/ClassRosterServiceLayerFileImpl.java +++ b/mod2/Class roster/src/serviceLayer/ClassRosterServiceLayerFileImpl.java @@ -80,6 +80,7 @@ public Student removeStudent(String studentId) throws ClassRosterPersistenceExce // Write to audit log auditDao.writeAuditEntry("Student " + studentId + " REMOVED."); return removedStudent; + } @Override diff --git a/mod2/adress Book/adress Book.jar b/mod2/adress Book/adress Book.jar new file mode 100644 index 0000000000000000000000000000000000000000..9db92df0f164979a2a212dfeb9ce67f26c412afa GIT binary patch literal 6277 zcma)A2UL^W(ha>!7my~>JBR`T0--4-^dg-ANoWBCLJ<)WK|y-&QZLd40w}#ikRrV( zN|mM{NH0?UME`pM-@C3iE8kjKE9cCa%${%0KBKLUgG&P-BqRj9&@a*loG}^zE&!yg z4-{0@R1pRNHC0uV_4I{6D#u*_z$U1tTSHw?Xn;&zkgvC=uTocJSZsQJ1Ju(qgy>Zj z5USR772uhkpPk1BXsZ(tCK5ua1<=0v(2w>%CqAhzJa-}y`d6Ty+j_KV)cF6o|n;V&{LIH#Xo`N+WIv4_gf74%A6cq zA}+86#ANFJ!SNn$e{)6zuHuG=NPm{-+>gWPG4s{kuVd+rt_s0hvhr=-6q%3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X(wAgMRHf6`;O9w&&6#l8!yMD}jWt7Z ziAjv@S1$#^KbB8Byx&S8r5@^cjpgvO7NIVzwhard6~$i5yCRZbl3oM9kI(UVXAg;D z*n5nlpm%Q(rDWQ3K|rNP2sOP;x}r1R67ygOe0`9Gl%e*C|JNK#Ol8b8UV~DgE8{cz z`S*-6pUfw=v5+}BTWKbjuSuIQQ5e~#)JzJi7yT@=Nr3ZGa`X_MCoAPny08KG2r=-sLw=VWeTCJ){)qG9czirhosl06M)=KiZ;$ z@i9}K8>G3E zC)}Y@`TfO5{GuQAD&MJ3WNQ)a1{`Wt4B-&f5xGP${_xcwsc4IpYhO)urFA%9r95zY zM=ISCRQdf~Wf=c@tJAW=Guo;9dt$Ao&TEu}zSG?0)ZelRGMpYaE;fs*%=%1wKh0W< z{!G{r!7YhkvYGXP8dX23T)QCD_>+}QTbfvK(XgBRkreRJxrDpeIzj%RV5t6C^NX;5 z)kJvog!7O*MNnV6bDCsoF8qOs9a}%^ZL`aXgaLd8w;Mvclyz1mI<3uagxJ=}(A}os z5b_4F5Q|odgKnFLkody-dXo1&cgNOP<*@3N`hY-r&Ba*l-9E192pfXx=7so!+=Hx? z{Ufg&{+pV(U969IG=+xsNu06G}&gWyt%#j%^5V1AgPgPj`ky*69hWp=3FE$hT>zArHT zy=|b#5Z%~Nbi`zlj-93)Ymw`V?1#I_cHFFicQVEAG^p3oemQ9yS=n(8jJH2z4bA5lf50>I(qh}FTyj$>8^y5e_JBEj+ozd69=U+m*KAW*v6L=I^Xi5&o-=eb#+dn_ zYx=Vh53y>EJ^bDjTSF|~*U3t}OOu;;;It>aAochaszl_6u9%Y(x2dIYyi{zBc`%I4>zFaCNN?Q zc%jqXgWxtVj*o-PgdB!Ek}rPBn?zR-FD`~Wu&`+Wrvu5egG0!68 z=kj0m+W($1$qT;;kn<@!+x;;Te!3 max) { + this.print("that number was to high"); + } else if (value < min) { + this.print("that number was to low"); + } else { + isCorrect = true; + } + } while (!isCorrect); + return value; + } + + @Override + public float readFloat(String prompt) { + boolean isCorrect = false; + float value = 0; + String userInput; + while (!isCorrect) { + userInput = this.readString(prompt); + try { + value = Float.parseFloat(userInput); + isCorrect = true; + } catch (Exception e) { + this.print("that was not a number please try again"); + } + } + return value; + } + + @Override + public float readFloat(String prompt, float min, float max) { + boolean isCorrect = false; + float value; + do { + value = this.readFloat(prompt); + if (value > max) { + this.print("that number was to high"); + } else if (value < min) { + this.print("that number was to low"); + } else { + isCorrect = true; + } + } while (!isCorrect); + return value; + } + + @Override + public double readDouble(String prompt) { + boolean isCorrect = false; + double value = 0; + String userInput; + while (!isCorrect) { + userInput = this.readString(prompt); + try { + value = Double.parseDouble(userInput); + isCorrect = true; + } catch (Exception e) { + this.print("That was not a double. Please try again"); + } + } + return value; + } + + @Override + public double readDouble(String prompt, Double min, Double max) { + boolean isCorrect = false; + double value; + do { + value = this.readDouble(prompt); + if (value > max) { + this.print("that number was to high"); + } else if (value < min) { + this.print("that number was to low"); + } else { + isCorrect = true; + } + } while (!isCorrect); + return value; + } + + @Override + public boolean readboolean(String prompt) { + boolean isCorrect = false; + boolean value = false; + String userInput; + while (!isCorrect) { + userInput = this.readString(prompt); + try { + value = Boolean.parseBoolean(userInput); + isCorrect = true; + } catch (Exception e) { + this.print("That was not a boolean. Please try again"); + } + } + return value; + } + + @Override + public long readLong(String prompt) { + boolean isCorrect = false; + String userInput; + long value = 0; + while (!isCorrect) { + userInput = this.readString(prompt); + try { + value = Long.parseLong(userInput); + isCorrect = true; + } catch (Exception e) { + this.print("That was not a double. Please try again"); + } + } + return value; + } + + public long readLong(String prompt, long min, long max) { + boolean isCorrect = false; + long value; + do { + value = this.readLong(prompt); + if (value > max) { + this.print("that number was to high"); + } else if (value < min) { + this.print("that number was to low"); + } else { + isCorrect = true; + } + } while (!isCorrect); + return value; + } + + @Override + public String readString(String prompt) { + this.print(prompt); + return this.sc.nextLine(); + } + + @Override + public void print(String msg) { + System.out.println(msg); + + } +} diff --git a/mod2/adress Book/src/exceptions/DataVialationException.java b/mod2/adress Book/src/exceptions/DataVialationException.java new file mode 100644 index 0000000..a5102f9 --- /dev/null +++ b/mod2/adress Book/src/exceptions/DataVialationException.java @@ -0,0 +1,11 @@ +package exceptions; + +public class DataVialationException extends Exception { + DataVialationException(String msg) { + super(msg); + } + + DataVialationException(String msg, Throwable cause) { + super(msg, cause); + } +} diff --git a/mod2/adress Book/src/exceptions/PersistenceException.java b/mod2/adress Book/src/exceptions/PersistenceException.java new file mode 100644 index 0000000..1b453b3 --- /dev/null +++ b/mod2/adress Book/src/exceptions/PersistenceException.java @@ -0,0 +1,11 @@ +package exceptions; + +public class PersistenceException extends Exception { + PersistenceException(String msg) { + super(msg); + } + + PersistenceException(String msg, Throwable cause) { + super(msg, cause); + } +} diff --git a/mod2/adress Book/src/exceptions/SameAdressException.java b/mod2/adress Book/src/exceptions/SameAdressException.java new file mode 100644 index 0000000..b61f0c7 --- /dev/null +++ b/mod2/adress Book/src/exceptions/SameAdressException.java @@ -0,0 +1,11 @@ +package exceptions; + +public class SameAdressException extends Exception { + SameAdressException(String msg) { + super(msg); + } + + SameAdressException(String msg, Throwable cause) { + super(msg, cause); + } +} diff --git a/mod2/adress Book/src/interfaces/Audit.java b/mod2/adress Book/src/interfaces/Audit.java new file mode 100644 index 0000000..ff94c4b --- /dev/null +++ b/mod2/adress Book/src/interfaces/Audit.java @@ -0,0 +1,5 @@ +package interfaces; + +public interface Audit { + +} diff --git a/mod2/adress Book/src/interfaces/Dao.java b/mod2/adress Book/src/interfaces/Dao.java new file mode 100644 index 0000000..0060e9a --- /dev/null +++ b/mod2/adress Book/src/interfaces/Dao.java @@ -0,0 +1,58 @@ +package interfaces; + +import java.util.List; + +import exceptions.PersistenceException; +import modle.Adress; + +public interface Dao { + /** + * creates an adress + * + * @param myAdress + * @return created adress + * @throws PersistenceException + */ + Adress createAdress(Adress myAdress) throws PersistenceException; + + /** + * deletes an adress + * + * @param myAdress + * @return deleted adress + * @throws PersistenceException + */ + Adress deleteAdress(Adress myAdress) throws PersistenceException; + + /** + * gets an adress by searching by name + * + * @param name + * @return searched adress + * @throws PersistenceException + */ + Adress getAdress(String name) throws PersistenceException; + + /** + * gets all the adresses + * + * @return all the adresses + * @throws PersistenceException + */ + List getAllAdresses() throws PersistenceException; + + /** + * instantiates all adresses to run the program and also makes the file if it + * does not exist + * + * @throws PersistenceException + */ + void run() throws PersistenceException; + + /** + * puts all the adresses into long term memory so you can close the program + * + * @throws PersistenceException + */ + void close() throws PersistenceException; +} diff --git a/mod2/adress Book/src/interfaces/ServiceLayer.java b/mod2/adress Book/src/interfaces/ServiceLayer.java new file mode 100644 index 0000000..ea67983 --- /dev/null +++ b/mod2/adress Book/src/interfaces/ServiceLayer.java @@ -0,0 +1,5 @@ +package interfaces; + +public interface ServiceLayer { + +} diff --git a/mod2/adress Book/src/interfaces/consoleIO.java b/mod2/adress Book/src/interfaces/consoleIO.java new file mode 100644 index 0000000..36ae013 --- /dev/null +++ b/mod2/adress Book/src/interfaces/consoleIO.java @@ -0,0 +1,50 @@ +package interfaces; + +public interface consoleIO { + /** + * prints msg + * + * @param msg + */ + public void print(String msg); + + /** + * gets an string and converts it to a int unless the string is not a number + * + * @param prompt + * @return the int that has been created + */ + public int readInt(String prompt); + + /** + * uses .readInt and only between min and max + * + * @param prompt + * @param min + * @param max + * @return the int between min and max + */ + public int readInt(String prompt, int min, int max); + + /** + * + * + * @param prompt + * @return + */ + public float readFloat(String prompt); + + public float readFloat(String prompt, float min, float max); + + public double readDouble(String prompt); + + public double readDouble(String prompt, Double min, Double max); + + public boolean readboolean(String prompt); + + public String readString(String prompt); + + public long readLong(String prompt); + + public long readLong(String prompt, long min, long max); +} diff --git a/mod2/adress Book/src/modle/Adress.java b/mod2/adress Book/src/modle/Adress.java new file mode 100644 index 0000000..b23acdf --- /dev/null +++ b/mod2/adress Book/src/modle/Adress.java @@ -0,0 +1,38 @@ +package modle; + +public class Adress { + private String firstName; + private String lastName; + private String adressName; + + Adress(String firstName, String lastName, String adressName) { + this.setFirstName(firstName); + this.setLastName(lastName); + this.setAdressName(adressName); + } + + public String getFirstName() { + return this.firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return this.lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getAdressName() { + return this.adressName; + } + + public void setAdressName(String adressName) { + this.adressName = adressName; + } + +} From 4fb942ba6968f1953e356e885366cd2854ea77ad Mon Sep 17 00:00:00 2001 From: bhimio Date: Wed, 11 May 2022 12:30:31 -0400 Subject: [PATCH 09/12] saving for later --- mod2/Class roster/.vscode/settings.json | 7 + mod2/adress Book/.vscode/settings.json | 8 + .../src/Contrllers/Controller.java | 15 ++ mod2/adress Book/src/IO/IO.java | 6 +- mod2/adress Book/src/IO/Veiw.java | 25 +++ .../ServiceLayer/ServiceLayerFileImpl.java | 12 ++ mod2/adress Book/src/audit/AuditDao.java | 7 + mod2/adress Book/src/dao/DaoFileImpl.java | 166 ++++++++++++++++++ .../src/exceptions/PersistenceException.java | 2 +- mod2/adress Book/src/interfaces/Dao.java | 8 + mod2/adress Book/src/modle/Adress.java | 4 +- 11 files changed, 255 insertions(+), 5 deletions(-) create mode 100644 mod2/Class roster/.vscode/settings.json create mode 100644 mod2/adress Book/.vscode/settings.json create mode 100644 mod2/adress Book/src/Contrllers/Controller.java create mode 100644 mod2/adress Book/src/IO/Veiw.java create mode 100644 mod2/adress Book/src/ServiceLayer/ServiceLayerFileImpl.java create mode 100644 mod2/adress Book/src/audit/AuditDao.java create mode 100644 mod2/adress Book/src/dao/DaoFileImpl.java diff --git a/mod2/Class roster/.vscode/settings.json b/mod2/Class roster/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/mod2/Class roster/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/mod2/adress Book/.vscode/settings.json b/mod2/adress Book/.vscode/settings.json new file mode 100644 index 0000000..3ae42db --- /dev/null +++ b/mod2/adress Book/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ], + "java.dependency.packagePresentation": "flat" +} diff --git a/mod2/adress Book/src/Contrllers/Controller.java b/mod2/adress Book/src/Contrllers/Controller.java new file mode 100644 index 0000000..702a92e --- /dev/null +++ b/mod2/adress Book/src/Contrllers/Controller.java @@ -0,0 +1,15 @@ +package Contrllers; + +import IO.Veiw; + +public class Controller { + private Veiw veiw; + + public Controller(Veiw veiw){ + this.veiw = veiw; + } + + public void run() { + + } +} diff --git a/mod2/adress Book/src/IO/IO.java b/mod2/adress Book/src/IO/IO.java index f008d0b..6259346 100644 --- a/mod2/adress Book/src/IO/IO.java +++ b/mod2/adress Book/src/IO/IO.java @@ -5,7 +5,11 @@ import interfaces.consoleIO; public class IO implements consoleIO { - private Scanner sc = new Scanner(System.in); + private Scanner sc; + + IO(Scanner sc) { + this.sc = sc; + } @Override public int readInt(String prompt) { diff --git a/mod2/adress Book/src/IO/Veiw.java b/mod2/adress Book/src/IO/Veiw.java new file mode 100644 index 0000000..d567d90 --- /dev/null +++ b/mod2/adress Book/src/IO/Veiw.java @@ -0,0 +1,25 @@ +package IO; + +import interfaces.consoleIO; + +public class Veiw { + consoleIO io; + private final String SPACE = " "; + + Veiw(consoleIO io) { + this.io = io; + } + + public int printMenu() { + io.print("=================="); + io.print("chose one of the folowing"); + io.print(SPACE + "1: create adress"); + io.print(SPACE + "2: list all adresses"); + io.print(SPACE + "3: search for a adress"); + io.print(SPACE + "4: count all the adresses"); + io.print(SPACE + "5: remove an adress"); + io.print(SPACE + "6: EXIT"); + + return io.readInt("", 1, 5); + } +} diff --git a/mod2/adress Book/src/ServiceLayer/ServiceLayerFileImpl.java b/mod2/adress Book/src/ServiceLayer/ServiceLayerFileImpl.java new file mode 100644 index 0000000..413b884 --- /dev/null +++ b/mod2/adress Book/src/ServiceLayer/ServiceLayerFileImpl.java @@ -0,0 +1,12 @@ +package ServiceLayer; + +import interfaces.Dao; +import interfaces.ServiceLayer; + +public class ServiceLayerFileImpl implements ServiceLayer { + Dao dao; + + public ServiceLayerFileImpl(Dao dao) { + this.dao = dao; + } +} diff --git a/mod2/adress Book/src/audit/AuditDao.java b/mod2/adress Book/src/audit/AuditDao.java new file mode 100644 index 0000000..38c8326 --- /dev/null +++ b/mod2/adress Book/src/audit/AuditDao.java @@ -0,0 +1,7 @@ +package audit; + +import interfaces.Audit; + +public class AuditDao implements Audit { + +} diff --git a/mod2/adress Book/src/dao/DaoFileImpl.java b/mod2/adress Book/src/dao/DaoFileImpl.java new file mode 100644 index 0000000..605f648 --- /dev/null +++ b/mod2/adress Book/src/dao/DaoFileImpl.java @@ -0,0 +1,166 @@ +package dao; + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Scanner; + +import exceptions.PersistenceException; +import interfaces.Dao; +import modle.Adress; + +public class DaoFileImpl implements Dao { + private Map adressMap = new HashMap<>(); + public static final String ADRESS_FILE = "book.txt"; + public static final String DELIMITER = "::"; + + public DaoFileImpl() { + + } + + @Override + public Adress createAdress(Adress myAdress) throws PersistenceException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Adress deleteAdress(Adress myAdress) throws PersistenceException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Adress getAdress(String name) throws PersistenceException { + // TODO Auto-generated method stub + return null; + } + + @Override + public List getAllAdresses() throws PersistenceException { + // TODO Auto-generated method stub + return null; + } + + @Override + public void run() throws PersistenceException { + // TODO Auto-generated method stub + + } + + @Override + public void close() throws PersistenceException { + // TODO Auto-generated method stub + + } + + @Override + public int count() { + return adressMap.size(); + } + + /** + * reads all Adresss from file + * preferably at startup + * + * @throws PersistenceException if an error occurs wile reading the + * file + */ + private void loadRoster() throws PersistenceException { + Scanner scanner; + + try { + // Create Scanner for reading the file + scanner = new Scanner( + new BufferedReader( + new FileReader(ADRESS_FILE))); + } catch (FileNotFoundException e) { + throw new PersistenceException( + "-_- Could not load roster data into memory.", e); + } + // currentLine holds the most recent line read from the file + String currentLine; + // currentTokens holds each of the parts of the currentLine after it has + // been split on our DELIMITER + // NOTE FOR APPRENTICES: In our case we use :: as our delimiter. If + // currentLine looks like this: + // 1234::Joe::Smith::Java-September2013 + // then currentTokens will be a string array that looks like this: + // + // ___________________________________ + // | | | | | + // |1234|Joe|Smith|Java-September2013| + // | | | | | + // ----------------------------------- + // [0] [1] [2] [3] + String[] currentTokens; + // Go through ROSTER_FILE line by line, decoding each line into a + // Adress object. + // Process while we have more lines in the file + while (scanner.hasNextLine()) { + // get the next line in the file + currentLine = scanner.nextLine(); + // break up the line into tokens + currentTokens = currentLine.split(DELIMITER); + // Create a new Adress object and put it into the map of Adress + // NOTE FOR APPRENTICES: We are going to use the Adress id + // which is currentTokens[0] as the map key for our Adress object. + // We also have to pass the Adress id into the Adress constructor + Adress currentAdress = new Adress(currentTokens[0]); + // Set the remaining vlaues on currentAdress manually + currentAdress.setFirstName(currentTokens[1]); + currentAdress.setLastName(currentTokens[2]); + // Put currentAdress into the map using AdressID as the key + adressMap.put(currentAdress.getFirstName(), currentAdress); + } + // close scanner + scanner.close(); + } + + /** + * Writes all Adresss in the roster out to a ROSTER_FILE. See loadRoster + * for file format. + * + * @throws PersistenceException if an error occurs writing to the + * file + */ + private void writeRoster() throws PersistenceException { + // NOTE FOR APPRENTICES: We are not handling the IOException - but + // we are translating it to an application specific exception and + // then simple throwing it (i.e. 'reporting' it) to the code that + // called us. It is the responsibility of the calling code to + // handle any errors that occur. + PrintWriter out; + + try { + out = new PrintWriter(new FileWriter(ADRESS_FILE)); + } catch (IOException e) { + throw new PersistenceException( + "Could not save Adress data.", e); + } + + // Write out the Adress objects to the roster file. + // NOTE TO THE APPRENTICES: We could just grab the Adress map, + // get the Collection of Adresss and iterate over them but we've + // already created a method that gets a List of Adresss so + // we'll reuse it. + List AdressList = this.getAllAdresses(); + for (Adress currentAdress : AdressList) { + // write the Adress object to the file + out.println(currentAdress.getAdressName() + DELIMITER + + currentAdress.getFirstName() + DELIMITER + + currentAdress.getLastName()); + // force PrintWriter to write line to the file + out.flush(); + } + // Clean up + out.close(); + } + +} diff --git a/mod2/adress Book/src/exceptions/PersistenceException.java b/mod2/adress Book/src/exceptions/PersistenceException.java index 1b453b3..b7816d2 100644 --- a/mod2/adress Book/src/exceptions/PersistenceException.java +++ b/mod2/adress Book/src/exceptions/PersistenceException.java @@ -5,7 +5,7 @@ public class PersistenceException extends Exception { super(msg); } - PersistenceException(String msg, Throwable cause) { + public PersistenceException(String msg, Throwable cause) { super(msg, cause); } } diff --git a/mod2/adress Book/src/interfaces/Dao.java b/mod2/adress Book/src/interfaces/Dao.java index 0060e9a..2e53e4e 100644 --- a/mod2/adress Book/src/interfaces/Dao.java +++ b/mod2/adress Book/src/interfaces/Dao.java @@ -55,4 +55,12 @@ public interface Dao { * @throws PersistenceException */ void close() throws PersistenceException; + + /** + * counts all the adresses + * + * @return the number of adresses + * @throws PersistenceException + */ + int count() throws PersistenceException; } diff --git a/mod2/adress Book/src/modle/Adress.java b/mod2/adress Book/src/modle/Adress.java index b23acdf..3d28faa 100644 --- a/mod2/adress Book/src/modle/Adress.java +++ b/mod2/adress Book/src/modle/Adress.java @@ -5,9 +5,7 @@ public class Adress { private String lastName; private String adressName; - Adress(String firstName, String lastName, String adressName) { - this.setFirstName(firstName); - this.setLastName(lastName); + public Adress(String adressName) { this.setAdressName(adressName); } From ddec20a5ac2c83a1f15c8b5071f8fda4242b3e3c Mon Sep 17 00:00:00 2001 From: bhimio Date: Tue, 31 May 2022 11:08:31 -0400 Subject: [PATCH 10/12] hello --- .gitignore | 3 +- mod2/Class roster/README.md | 18 +++++ mod2/Librairy/bin/storage/OutFile.txt | 2 +- mod2/adress Book/README.md | 18 +++++ mod2/adress Book/src/App.java | 2 +- .../src/Contrllers/Controller.java | 45 ++++++++++- mod2/adress Book/src/IO/Veiw.java | 9 +++ mod2/adress Book/src/audit/AuditDao.java | 21 ++++++ mod2/adress Book/src/dao/DaoFileImpl.java | 13 ++-- mod2/adress Book/src/interfaces/Audit.java | 10 ++- mod2/d&d.vs/things .txt | 3 + mod4/FirstMavenProject/pom.xml | 28 +++++++ .../firstmavenproject/FirstMavenProject.java | 20 +++++ .../src/main/java/greatParty/GreatParty.java | 24 ++++++ .../main/java/greatParty/GreatPartyTest.java | 34 +++++++++ mod4/demo/pom.xml | 75 +++++++++++++++++++ .../src/main/java/com/example/bhima/App.java | 13 ++++ .../test/java/com/example/bhima/AppTest.java | 20 +++++ mod4/rats/.vscode/settings.json | 4 + mod4/rats/pom.xml | 75 +++++++++++++++++++ .../src/main/java/com/text/greateParty.java | 22 ++++++ mod4/rats/src/test/java/com/text/AppTest.java | 15 ++++ 22 files changed, 461 insertions(+), 13 deletions(-) create mode 100644 mod2/Class roster/README.md create mode 100644 mod2/adress Book/README.md create mode 100644 mod2/d&d.vs/things .txt create mode 100644 mod4/FirstMavenProject/pom.xml create mode 100644 mod4/FirstMavenProject/src/main/java/com/mycompany/firstmavenproject/FirstMavenProject.java create mode 100644 mod4/FirstMavenProject/src/main/java/greatParty/GreatParty.java create mode 100644 mod4/FirstMavenProject/src/main/java/greatParty/GreatPartyTest.java create mode 100644 mod4/demo/pom.xml create mode 100644 mod4/demo/src/main/java/com/example/bhima/App.java create mode 100644 mod4/demo/src/test/java/com/example/bhima/AppTest.java create mode 100644 mod4/rats/.vscode/settings.json create mode 100644 mod4/rats/pom.xml create mode 100644 mod4/rats/src/main/java/com/text/greateParty.java create mode 100644 mod4/rats/src/test/java/com/text/AppTest.java diff --git a/.gitignore b/.gitignore index 8399968..925de21 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -**/*.class \ No newline at end of file +**/*.class +/mod4/FirstMavenProject/target/ diff --git a/mod2/Class roster/README.md b/mod2/Class roster/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/mod2/Class roster/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/mod2/Librairy/bin/storage/OutFile.txt b/mod2/Librairy/bin/storage/OutFile.txt index df29ab0..ab35ce3 100644 --- a/mod2/Librairy/bin/storage/OutFile.txt +++ b/mod2/Librairy/bin/storage/OutFile.txt @@ -1 +1 @@ -fyfyus::hasgfgdfh::sfgsfg::false::0 +rock::god::hat::false::0 diff --git a/mod2/adress Book/README.md b/mod2/adress Book/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/mod2/adress Book/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/mod2/adress Book/src/App.java b/mod2/adress Book/src/App.java index 0a839f9..2add349 100644 --- a/mod2/adress Book/src/App.java +++ b/mod2/adress Book/src/App.java @@ -1,5 +1,5 @@ public class App { public static void main(String[] args) throws Exception { - System.out.println("Hello, World!"); + } } diff --git a/mod2/adress Book/src/Contrllers/Controller.java b/mod2/adress Book/src/Contrllers/Controller.java index 702a92e..11d912c 100644 --- a/mod2/adress Book/src/Contrllers/Controller.java +++ b/mod2/adress Book/src/Contrllers/Controller.java @@ -3,13 +3,56 @@ import IO.Veiw; public class Controller { - private Veiw veiw; + Veiw veiw; public Controller(Veiw veiw){ this.veiw = veiw; } public void run() { + boolean keepGoing = true; + int menuSelection = 0; + while (keepGoing) { + + menuSelection = getMenu(); + + switch (menuSelection) { + case 1: + listStudents(); + break; + case 2: + createStudent(); + break; + case 3: + viewStudent(); + break; + case 4: + removeStudent(); + break; + case 5: + keepGoing = false; + break; + default: + + } + + } + } + + private void removeStudent() { + } + + private void viewStudent() { + } + + private void createStudent() { + } + + private void listStudents() { + } + + private int getMenu() { + return veiw.printMenu(); } } diff --git a/mod2/adress Book/src/IO/Veiw.java b/mod2/adress Book/src/IO/Veiw.java index d567d90..812e8b7 100644 --- a/mod2/adress Book/src/IO/Veiw.java +++ b/mod2/adress Book/src/IO/Veiw.java @@ -22,4 +22,13 @@ public int printMenu() { return io.readInt("", 1, 5); } + + public void baner(String msg) { + io.print("===== " + msg + " ====="); + } + + public void errorMessage(String errorMsg) { + io.print("==== ERROR ===="); + io.print(errorMsg); + } } diff --git a/mod2/adress Book/src/audit/AuditDao.java b/mod2/adress Book/src/audit/AuditDao.java index 38c8326..72e68f8 100644 --- a/mod2/adress Book/src/audit/AuditDao.java +++ b/mod2/adress Book/src/audit/AuditDao.java @@ -1,7 +1,28 @@ package audit; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.time.LocalDateTime; + +import exceptions.PersistenceException; import interfaces.Audit; public class AuditDao implements Audit { + public static final String AUDIT_FILE = "audit.txt"; + + @Override + public void writeAuditEntry(String entry) throws PersistenceException { + PrintWriter out; + + try { + out = new PrintWriter(new FileWriter(AUDIT_FILE, true)); + } catch (IOException e) { + throw new PersistenceException("Could not persist audit information.", e); + } + LocalDateTime timestamp = LocalDateTime.now(); + out.println(timestamp.toString() + " : " + entry); + out.flush(); + } } diff --git a/mod2/adress Book/src/dao/DaoFileImpl.java b/mod2/adress Book/src/dao/DaoFileImpl.java index 605f648..f551f0b 100644 --- a/mod2/adress Book/src/dao/DaoFileImpl.java +++ b/mod2/adress Book/src/dao/DaoFileImpl.java @@ -6,6 +6,7 @@ import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -20,14 +21,10 @@ public class DaoFileImpl implements Dao { public static final String ADRESS_FILE = "book.txt"; public static final String DELIMITER = "::"; - public DaoFileImpl() { - - } - @Override public Adress createAdress(Adress myAdress) throws PersistenceException { - // TODO Auto-generated method stub - return null; + Adress newAdress = adressMap.put(myAdress.getAdressName(), myAdress); + return newAdress; } @Override @@ -44,8 +41,8 @@ public Adress getAdress(String name) throws PersistenceException { @Override public List getAllAdresses() throws PersistenceException { - // TODO Auto-generated method stub - return null; + this.loadRoster(); + return new ArrayList(adressMap.values()); } @Override diff --git a/mod2/adress Book/src/interfaces/Audit.java b/mod2/adress Book/src/interfaces/Audit.java index ff94c4b..42cc056 100644 --- a/mod2/adress Book/src/interfaces/Audit.java +++ b/mod2/adress Book/src/interfaces/Audit.java @@ -1,5 +1,13 @@ package interfaces; +import exceptions.PersistenceException; + public interface Audit { - + /** + * writes a Audit + * + * @param entry + * @throws ClassRosterPersistenceException + */ + void writeAuditEntry(String entry) throws PersistenceException; } diff --git a/mod2/d&d.vs/things .txt b/mod2/d&d.vs/things .txt new file mode 100644 index 0000000..9a00bdd --- /dev/null +++ b/mod2/d&d.vs/things .txt @@ -0,0 +1,3 @@ + Math. round () - this method rounds a number to the nearest integer. ... + Math. floor () - this method rounds a number downward to the nearest integer. ... + Math. ceil() - this method rounds a number upward to its nearest integer. \ No newline at end of file diff --git a/mod4/FirstMavenProject/pom.xml b/mod4/FirstMavenProject/pom.xml new file mode 100644 index 0000000..2feec73 --- /dev/null +++ b/mod4/FirstMavenProject/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + com.mycompany.firstmavenproject + FirstMavenProject + 1.0-SNAPSHOT + + UTF-8 + 18 + 18 + com.mycompany.firstmavenproject.FirstMavenProject + + + + org.springframework + spring-context + 4.3.4.RELEASE + + + + junit + junit + 4.11 + test + + + + \ No newline at end of file diff --git a/mod4/FirstMavenProject/src/main/java/com/mycompany/firstmavenproject/FirstMavenProject.java b/mod4/FirstMavenProject/src/main/java/com/mycompany/firstmavenproject/FirstMavenProject.java new file mode 100644 index 0000000..a564b20 --- /dev/null +++ b/mod4/FirstMavenProject/src/main/java/com/mycompany/firstmavenproject/FirstMavenProject.java @@ -0,0 +1,20 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Project/Maven2/JavaApp/src/main/java/${packagePath}/${mainClassName}.java to edit this template + */ + +package com.mycompany.firstmavenproject; + +/** + * + * @author bhima + */ +public class FirstMavenProject { + + public static void main(String[] args) { + System.out.println("Hello World!"); + } + + + +} diff --git a/mod4/FirstMavenProject/src/main/java/greatParty/GreatParty.java b/mod4/FirstMavenProject/src/main/java/greatParty/GreatParty.java new file mode 100644 index 0000000..a029af6 --- /dev/null +++ b/mod4/FirstMavenProject/src/main/java/greatParty/GreatParty.java @@ -0,0 +1,24 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package greatParty; + +/** + * + * @author bhima + */ +public class GreatParty { + // When squirrels get together for a party, they like to have cigars. +// A squirrel party is successful when the number of cigars is between +// 40 and 60, inclusive. Unless it is the weekend, in which case there +// is no upper bound on the number of cigars. Return true if the party +// with the given values is successful, or false otherwise. +// +// greatParty(30, false) → false +// greatParty(50, false) → true +// greatParty(70, true) → true +public boolean greatParty(int cigars, boolean isWeekend) { + throw new UnsupportedOperationException("Not implemented"); +} +} diff --git a/mod4/FirstMavenProject/src/main/java/greatParty/GreatPartyTest.java b/mod4/FirstMavenProject/src/main/java/greatParty/GreatPartyTest.java new file mode 100644 index 0000000..adf336f --- /dev/null +++ b/mod4/FirstMavenProject/src/main/java/greatParty/GreatPartyTest.java @@ -0,0 +1,34 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package greatParty; + +import org.JU + +/** + * + * @author bhima + */ +public class GreatPartyTest { + GreatParty party = new GreatParty(); + + public GreatPartyTest() { + } + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + @Before + public void setUp() { + } + + @After + public void teardown() { + } +} diff --git a/mod4/demo/pom.xml b/mod4/demo/pom.xml new file mode 100644 index 0000000..24e5e42 --- /dev/null +++ b/mod4/demo/pom.xml @@ -0,0 +1,75 @@ + + + + 4.0.0 + + com.example.bhima + demo + 1.0-SNAPSHOT + + demo + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/mod4/demo/src/main/java/com/example/bhima/App.java b/mod4/demo/src/main/java/com/example/bhima/App.java new file mode 100644 index 0000000..53e39e2 --- /dev/null +++ b/mod4/demo/src/main/java/com/example/bhima/App.java @@ -0,0 +1,13 @@ +package com.example.bhima; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/mod4/demo/src/test/java/com/example/bhima/AppTest.java b/mod4/demo/src/test/java/com/example/bhima/AppTest.java new file mode 100644 index 0000000..d1b2e10 --- /dev/null +++ b/mod4/demo/src/test/java/com/example/bhima/AppTest.java @@ -0,0 +1,20 @@ +package com.example.bhima; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class AppTest +{ + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() + { + assertTrue( true ); + } +} diff --git a/mod4/rats/.vscode/settings.json b/mod4/rats/.vscode/settings.json new file mode 100644 index 0000000..779a1b4 --- /dev/null +++ b/mod4/rats/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive", + "maven.view": "flat" +} \ No newline at end of file diff --git a/mod4/rats/pom.xml b/mod4/rats/pom.xml new file mode 100644 index 0000000..8e27964 --- /dev/null +++ b/mod4/rats/pom.xml @@ -0,0 +1,75 @@ + + + + 4.0.0 + + com.text + rats + 1.0-SNAPSHOT + + rats + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/mod4/rats/src/main/java/com/text/greateParty.java b/mod4/rats/src/main/java/com/text/greateParty.java new file mode 100644 index 0000000..8b6011e --- /dev/null +++ b/mod4/rats/src/main/java/com/text/greateParty.java @@ -0,0 +1,22 @@ +package com.text; + +public class greateParty { + // When squirrels get together for a party, they like to have cigars. + // A squirrel party is successful when the number of cigars is between + // 40 and 60, inclusive. Unless it is the weekend, in which case there + // is no upper bound on the number of cigars. Return true if the party + // with the given values is successful, or false otherwise. + // + // greatParty(30, false) → false + // greatParty(50, false) → true + // greatParty(70, true) → true + public boolean greatParty(int cigars, boolean isWeekend) { + if (cigars > 40 && cigars < 60 && !isWeekend) { + return true; + } else if (cigars > 40 && isWeekend) { + return true; + } else { + return false; + } + } +} diff --git a/mod4/rats/src/test/java/com/text/AppTest.java b/mod4/rats/src/test/java/com/text/AppTest.java new file mode 100644 index 0000000..14da253 --- /dev/null +++ b/mod4/rats/src/test/java/com/text/AppTest.java @@ -0,0 +1,15 @@ +package com.text; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class AppTest { + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() { + assertTrue(true); + } +} From c790eac169e2591492c3d6d7bfdeb569c48da23a Mon Sep 17 00:00:00 2001 From: bhimio Date: Tue, 31 May 2022 11:31:25 -0400 Subject: [PATCH 11/12] another --- .../{greateParty.java => GreateParty.java} | 2 +- mod4/rats/src/test/java/com/text/AppTest.java | 15 ------ .../test/java/com/text/GreatePartyTest.java | 47 +++++++++++++++++++ 3 files changed, 48 insertions(+), 16 deletions(-) rename mod4/rats/src/main/java/com/text/{greateParty.java => GreateParty.java} (96%) delete mode 100644 mod4/rats/src/test/java/com/text/AppTest.java create mode 100644 mod4/rats/src/test/java/com/text/GreatePartyTest.java diff --git a/mod4/rats/src/main/java/com/text/greateParty.java b/mod4/rats/src/main/java/com/text/GreateParty.java similarity index 96% rename from mod4/rats/src/main/java/com/text/greateParty.java rename to mod4/rats/src/main/java/com/text/GreateParty.java index 8b6011e..208b757 100644 --- a/mod4/rats/src/main/java/com/text/greateParty.java +++ b/mod4/rats/src/main/java/com/text/GreateParty.java @@ -1,6 +1,6 @@ package com.text; -public class greateParty { +public class GreateParty { // When squirrels get together for a party, they like to have cigars. // A squirrel party is successful when the number of cigars is between // 40 and 60, inclusive. Unless it is the weekend, in which case there diff --git a/mod4/rats/src/test/java/com/text/AppTest.java b/mod4/rats/src/test/java/com/text/AppTest.java deleted file mode 100644 index 14da253..0000000 --- a/mod4/rats/src/test/java/com/text/AppTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.text; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -public class AppTest { - /** - * Rigorous Test :-) - */ - @Test - public void shouldAnswerWithTrue() { - assertTrue(true); - } -} diff --git a/mod4/rats/src/test/java/com/text/GreatePartyTest.java b/mod4/rats/src/test/java/com/text/GreatePartyTest.java new file mode 100644 index 0000000..b8fcc24 --- /dev/null +++ b/mod4/rats/src/test/java/com/text/GreatePartyTest.java @@ -0,0 +1,47 @@ +package com.text; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class GreatePartyTest { + GreateParty party = new GreateParty(); + + public GreatePartyTest() { + } + + @BeforeClass + public static void setUpClass() { + + } + + @AfterClass + public static void tearDownClass() { + + } + + @Before + public void setUp() { + + } + + @After + public void tearDown() { + + } + + @Test + public void test30False() { + assertFalse(party.greatParty(30, false)); + } + + @Test + public void test50False() { + assertTrue(party.greatParty(50, false)); + } +} From cee55e429c44d9ee604ade488e74ca93ffcc4023 Mon Sep 17 00:00:00 2001 From: bhimio Date: Tue, 7 Mar 2023 08:19:39 -0500 Subject: [PATCH 12/12] message --- console.sql | 1 + mod4/datetime/datetime.jar | Bin 0 -> 2666 bytes mod4/datetime/pom.xml | 75 +++++ .../datetime/src/main/java/com/bhima/App.java | 56 ++++ .../src/test/java/com/bhima/AppTest.java | 20 ++ mod4/myspringproject/.gitignore | 33 ++ .../.mvn/wrapper/maven-wrapper.jar | Bin 0 -> 58727 bytes .../.mvn/wrapper/maven-wrapper.properties | 2 + mod4/myspringproject/mvnw | 316 ++++++++++++++++++ mod4/myspringproject/mvnw.cmd | 188 +++++++++++ mod4/myspringproject/pom.xml | 50 +++ .../java/com/bhima/myspringproject/Book.java | 46 +++ .../myspringproject/GreetingController.java | 22 ++ .../MyspringprojectApplication.java | 13 + .../bhima/myspringproject/RootReposotory.java | 0 .../myspringproject/ServletInitializer.java | 13 + .../src/main/resources/application.properties | 5 + .../src/main/resources/static/index.html | 21 ++ .../src/main/resources/templates/error.html | 22 ++ .../main/resources/templates/greeting.html | 10 + .../MyspringprojectApplicationTests.java | 13 + mod4/randomWord/.vscode/settings.json | 7 + mod4/randomWord/README.md | 18 + mod4/randomWord/java | 0 mod4/randomWord/json | 0 mod4/randomWord/random word.jar | Bin 0 -> 1482 bytes mod4/randomWord/src/App.java | 111 ++++++ mod4/randomWord/src/RandomWord.java | 111 ++++++ mod4/rats/.vscode/settings.json | 2 +- mod4/rats/pom.xml | 13 +- mod4/rats/src/main/applicationContext.xml | 20 ++ .../com/text/{GreateParty.java => App.java} | 2 +- .../test/java/com/text/GreatePartyTest.java | 44 +-- mod4/server of the gods/.vscode/settings.json | 7 + mod4/server of the gods/README.md | 18 + mod4/server of the gods/src/App.java | 7 + .../src/dao/DaoMemoryImpl.java | 76 +++++ .../src/interfaces/dao.java | 18 + mod4/server of the gods/src/modle/Server.java | 75 +++++ 39 files changed, 1386 insertions(+), 49 deletions(-) create mode 100644 console.sql create mode 100755 mod4/datetime/datetime.jar create mode 100644 mod4/datetime/pom.xml create mode 100644 mod4/datetime/src/main/java/com/bhima/App.java create mode 100644 mod4/datetime/src/test/java/com/bhima/AppTest.java create mode 100644 mod4/myspringproject/.gitignore create mode 100644 mod4/myspringproject/.mvn/wrapper/maven-wrapper.jar create mode 100644 mod4/myspringproject/.mvn/wrapper/maven-wrapper.properties create mode 100755 mod4/myspringproject/mvnw create mode 100644 mod4/myspringproject/mvnw.cmd create mode 100644 mod4/myspringproject/pom.xml create mode 100644 mod4/myspringproject/src/main/java/com/bhima/myspringproject/Book.java create mode 100644 mod4/myspringproject/src/main/java/com/bhima/myspringproject/GreetingController.java create mode 100644 mod4/myspringproject/src/main/java/com/bhima/myspringproject/MyspringprojectApplication.java create mode 100644 mod4/myspringproject/src/main/java/com/bhima/myspringproject/RootReposotory.java create mode 100644 mod4/myspringproject/src/main/java/com/bhima/myspringproject/ServletInitializer.java create mode 100644 mod4/myspringproject/src/main/resources/application.properties create mode 100644 mod4/myspringproject/src/main/resources/static/index.html create mode 100644 mod4/myspringproject/src/main/resources/templates/error.html create mode 100644 mod4/myspringproject/src/main/resources/templates/greeting.html create mode 100644 mod4/myspringproject/src/test/java/com/bhima/myspringproject/MyspringprojectApplicationTests.java create mode 100644 mod4/randomWord/.vscode/settings.json create mode 100644 mod4/randomWord/README.md create mode 100644 mod4/randomWord/java create mode 100644 mod4/randomWord/json create mode 100644 mod4/randomWord/random word.jar create mode 100644 mod4/randomWord/src/App.java create mode 100644 mod4/randomWord/src/RandomWord.java create mode 100644 mod4/rats/src/main/applicationContext.xml rename mod4/rats/src/main/java/com/text/{GreateParty.java => App.java} (96%) create mode 100644 mod4/server of the gods/.vscode/settings.json create mode 100644 mod4/server of the gods/README.md create mode 100644 mod4/server of the gods/src/App.java create mode 100644 mod4/server of the gods/src/dao/DaoMemoryImpl.java create mode 100644 mod4/server of the gods/src/interfaces/dao.java create mode 100644 mod4/server of the gods/src/modle/Server.java diff --git a/console.sql b/console.sql new file mode 100644 index 0000000..f794a1a --- /dev/null +++ b/console.sql @@ -0,0 +1 @@ +select * from Book \ No newline at end of file diff --git a/mod4/datetime/datetime.jar b/mod4/datetime/datetime.jar new file mode 100755 index 0000000000000000000000000000000000000000..2fce0f770f476dcb7f8808dec8e2bc4fe0b311c9 GIT binary patch literal 2666 zcmaJ@2{@GN7yptPW63r#BTK35rimXQ3{obDmb~h^oU}IwgbV*Mv zfNu-}umU(e3mth3UjGc_SO60&i0!Pj#|3rfRwtRS3G)E# z0Kf+P&jDDOU!Bf-AN#onGwzFrqno?8!xz7=rKtR;6#no0bbNi`PF@cF{_z&GX1&^w zO#yayT^_j?B;9$-spJU3(vK_=hDrzd(7X1RwF^xA2F|;yIB)r3x0>4I?#~J};gcAd z+$(B59bPWWZ&x~kYWzQ~uW!tOem#pgaspB6l3kTKsIX|0Jv5reMm6NkWN!H6Yy`#ol_YqNfBD&3PXtWMLk=*oo%m~UJsi9RQM6T4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ZWjv#*pW5g>Wyt#^S%8{Q%k7ANl*`U}x3$Z+6uPZlcC3}T+==^_F~2Q%JHfYu zw9T|TX2-04C&Bl;``;|zwsd>wb}R$*qb&c7pb2&llluW+FY^gw{*Hd8xC4N{0e3Yj A5&!@I literal 0 HcmV?d00001 diff --git a/mod4/datetime/pom.xml b/mod4/datetime/pom.xml new file mode 100644 index 0000000..6d29bcc --- /dev/null +++ b/mod4/datetime/pom.xml @@ -0,0 +1,75 @@ + + + + 4.0.0 + + com.bhima + datetime + 1.0-SNAPSHOT + + datetime + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/mod4/datetime/src/main/java/com/bhima/App.java b/mod4/datetime/src/main/java/com/bhima/App.java new file mode 100644 index 0000000..45d8f22 --- /dev/null +++ b/mod4/datetime/src/main/java/com/bhima/App.java @@ -0,0 +1,56 @@ +package com.bhima; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.Date; + +public class App { + public App(String[] args) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy"); + LocalDate ld = LocalDate.parse("02/07/2010", formatter); + String formatted = ld.format(formatter); + Date legacyDate = new Date(); + ZonedDateTime zdt = ZonedDateTime.ofInstant( + legacyDate.toInstant(), ZoneId.systemDefault()); + ld = zdt.toLocalDate(); + formatted = ld.format(DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL)); + System.out.println(formatted); + InnerApp_1 iApp_1 = new InnerApp_1(args); + } +} + +class InnerApp { + public static void main(String[] args) { + BigDecimal a = new BigDecimal("42.35"); + BigDecimal b; + b = a.setScale(1, RoundingMode.HALF_UP); + System.out.println(b.toString()); + b = a.setScale(1, RoundingMode.HALF_DOWN); + System.out.println(b.toString()); // 42.3 + BigDecimal op1 = new BigDecimal("10"); + BigDecimal op2 = new BigDecimal("4"); + BigDecimal c = op1.divide(op2); // ERROR + System.out.println(c); + c = op1.divide(op2, RoundingMode.HALF_UP); // 2 + System.out.println(c.toString()); + + c = op1.divide(op2, 2, RoundingMode.HALF_UP); // 1.67 + System.out.println(c.toString()); + + c = op1.divide(op2, 2, RoundingMode.DOWN); // 1.66 + System.out.println(c.toString()); + App app = new App(args); + + } +} + +class InnerApp_1 { + public InnerApp_1(String[] args) { + + } +} diff --git a/mod4/datetime/src/test/java/com/bhima/AppTest.java b/mod4/datetime/src/test/java/com/bhima/AppTest.java new file mode 100644 index 0000000..6e23f01 --- /dev/null +++ b/mod4/datetime/src/test/java/com/bhima/AppTest.java @@ -0,0 +1,20 @@ +package com.bhima; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class AppTest +{ + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() + { + assertTrue( true ); + } +} diff --git a/mod4/myspringproject/.gitignore b/mod4/myspringproject/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/mod4/myspringproject/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/mod4/myspringproject/.mvn/wrapper/maven-wrapper.jar b/mod4/myspringproject/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..c1dd12f17644411d6e840bd5a10c6ecda0175f18 GIT binary patch literal 58727 zcmb5W18`>1vNjyPv28mO+cqb*Z6_1kwr$(?#I}=(ZGUs`Jr}3`|DLbDUA3!L?dtC8 zUiH*ktDo+@6r@4HP=SCTA%WmZqm^Ro`Ls)bfPkcdfq?#g1(Fq27W^S8Cq^$TC?_c< zs-#ROD;6C)1wFuk7<3)nGuR^#!H;n&3*IjzXg+s8Z_S!!E0jUq(`}Itt=YdYa5Z_s z&e>2={87knpF*PKNzU;lsbk#P(l^WBvb$yEz)z+nYH43pKodrDkMp@h?;n{;K}hl>Fb^ zqx}C0|D7kg|Cj~3f7hn_zkAE}|6t|cZT|S5Hvb#3nc~C14u5UI{6#F<|FkJ0svs&S zA}S{=DXLT*BM1$`2rK%`D@vEw9l9%*=92X_2g?Fwfi=6Zfpr7+<~sgP#Bav+Df2ts zwtu~70zhqV?mrzM)}r7mMS`Hk_)NrI5K%CTtQtDxqw5iv5F0!ksIon{qqpPVnU?ds zN$|Vm{MHKEReUy>1kVfT-$3))Js0p2W_LFy3cjjZ7za0R zPdBH>y&pb0vr1|ckDpt2p$IQhwnPs5G*^b-y}sg4W!ALn}a`pY0JIa$H0$eV2T8WjWD= zWaENacQhlTyK4O!+aOXBurVR2k$eb8HVTCxy-bcHlZ4Xr!`juLAL#?t6|Ba!g9G4I zSwIt2Lla>C?C4wAZ8cKsZl9-Yd3kqE`%!5HlGdJJaFw0mu#--&**L-i|BcIdc3B$;0FC;FbE-dunVZ; zdIQ=tPKH4iJQQ=$5BeEMLov_Hn>gXib|9nOr}>eZt@B4W^m~>Zp#xhn1dax+?hS!AchWJ4makWZs@dQUeXQ zsI2+425_{X@t2KN zIbqec#)Jg5==VY3^YBeJ2B+%~^Y8|;F!mE8d(`UgNl2B9o>Ir5)qbBr)a?f%nrP zQyW(>FYPZjCV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z}grIo^bNVDw4={SA2*nDNq5`e@ZO5r4TbQpHM)~qfD9!s0h(Jf>vYd;I~j<2fD4)_>ctbwNX6S*8>i^*4 zYKI5<4}d;hM!!N|A$@eg09J|HV;!UUVIau_I~dxZp#?a3u0G)pts6GKdCNk>FKxdh_`Xu!>zO3Kv?u+W6cYJPy!@=PuY868>3|Zg} z$7galV~M`d!q(`I{;CJsq6G9>W0}H6gVY`q7S@9s8ak1r{>}*Q0JyH&f!f8(NZxhC zkn|KS64r^A1fniFel2KkxYByk%erCx9UgFLI)`yuA)X z8SU?6kj!numPNCAj}>1ipax(t{%rxU;6`(Nqt$~Z4~76TQ$9d8l`yJ}rniII%HbH= zlS_7o!qB{55at^>N!Voer%)`KMh9Yd@Z?~nc19*hs)NGN954`O9zA&&vJHbm&|D@E za(&z6A=3NfC;>I)hlI@ulP8E@W-ziGe{iCf_mHvWGldxw8{ng-hI({EtOdALnD9zG ze)fU?I(DNt)Bzdd9Cs^>!|+2!xv1SK=I zJ+y_;=Sq-zqD~GKy@{5(my&aPgFfGY&_mayR_)?dF_^Fwc-n!UAG+fQQGfjWE-1MF YM{}PByk10KD_nuQ4E7Du?}+~TKh4V)`~Uy| literal 0 HcmV?d00001 diff --git a/mod4/myspringproject/.mvn/wrapper/maven-wrapper.properties b/mod4/myspringproject/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..b7cb93e --- /dev/null +++ b/mod4/myspringproject/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar diff --git a/mod4/myspringproject/mvnw b/mod4/myspringproject/mvnw new file mode 100755 index 0000000..8a8fb22 --- /dev/null +++ b/mod4/myspringproject/mvnw @@ -0,0 +1,316 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`\\unset -f command; \\command -v java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mod4/myspringproject/mvnw.cmd b/mod4/myspringproject/mvnw.cmd new file mode 100644 index 0000000..1d8ab01 --- /dev/null +++ b/mod4/myspringproject/mvnw.cmd @@ -0,0 +1,188 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/mod4/myspringproject/pom.xml b/mod4/myspringproject/pom.xml new file mode 100644 index 0000000..b685067 --- /dev/null +++ b/mod4/myspringproject/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.6.3 + + + com.example + serving-web-content-complete + 0.0.1-SNAPSHOT + serving-web-content-complete + Demo project for Spring Boot + + 1.8 + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + + mysql + mysql-connector-java + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/mod4/myspringproject/src/main/java/com/bhima/myspringproject/Book.java b/mod4/myspringproject/src/main/java/com/bhima/myspringproject/Book.java new file mode 100644 index 0000000..34c88c7 --- /dev/null +++ b/mod4/myspringproject/src/main/java/com/bhima/myspringproject/Book.java @@ -0,0 +1,46 @@ +package com.bhima.myspringproject; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; + + +import org.springframework.data.annotation.Id; + +@Entity +public class Book { + @Id + @GeneratedValue(strategy=GenerationType.AUTO) + private Integer id; + private String title; + private String author; + + public Book(String title){ + this.setTitle(title); + } + + public int getId() { + return this.id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return this.author; + } + + public void setAuthor(String author) { + this.author = author; + } + +} diff --git a/mod4/myspringproject/src/main/java/com/bhima/myspringproject/GreetingController.java b/mod4/myspringproject/src/main/java/com/bhima/myspringproject/GreetingController.java new file mode 100644 index 0000000..e7150c7 --- /dev/null +++ b/mod4/myspringproject/src/main/java/com/bhima/myspringproject/GreetingController.java @@ -0,0 +1,22 @@ +package com.bhima.myspringproject; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +@Controller +public class GreetingController { + + @GetMapping("/greeting") + public String greeting(@RequestParam(name="name", required=false, defaultValue="World") String name, Model model) { + model.addAttribute("name", name); + return "greeting"; + } + + @GetMapping("/error") + public String error() { + return "error"; + } + +} \ No newline at end of file diff --git a/mod4/myspringproject/src/main/java/com/bhima/myspringproject/MyspringprojectApplication.java b/mod4/myspringproject/src/main/java/com/bhima/myspringproject/MyspringprojectApplication.java new file mode 100644 index 0000000..f5a5e88 --- /dev/null +++ b/mod4/myspringproject/src/main/java/com/bhima/myspringproject/MyspringprojectApplication.java @@ -0,0 +1,13 @@ +package com.bhima.myspringproject; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MyspringprojectApplication { + + public static void main(String[] args) { + SpringApplication.run(MyspringprojectApplication.class, args); + } + +} diff --git a/mod4/myspringproject/src/main/java/com/bhima/myspringproject/RootReposotory.java b/mod4/myspringproject/src/main/java/com/bhima/myspringproject/RootReposotory.java new file mode 100644 index 0000000..e69de29 diff --git a/mod4/myspringproject/src/main/java/com/bhima/myspringproject/ServletInitializer.java b/mod4/myspringproject/src/main/java/com/bhima/myspringproject/ServletInitializer.java new file mode 100644 index 0000000..e7548ab --- /dev/null +++ b/mod4/myspringproject/src/main/java/com/bhima/myspringproject/ServletInitializer.java @@ -0,0 +1,13 @@ +package com.bhima.myspringproject; + +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +public class ServletInitializer extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(MyspringprojectApplication.class); + } + +} diff --git a/mod4/myspringproject/src/main/resources/application.properties b/mod4/myspringproject/src/main/resources/application.properties new file mode 100644 index 0000000..346fdd4 --- /dev/null +++ b/mod4/myspringproject/src/main/resources/application.properties @@ -0,0 +1,5 @@ +spring.jpa.hibernate.ddl-auto=update +spring.datasource.url=jdbc:mysql://localhost:3306/library +spring.datasource.username=root +spring.datasource.passsword=mynewpassword +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver \ No newline at end of file diff --git a/mod4/myspringproject/src/main/resources/static/index.html b/mod4/myspringproject/src/main/resources/static/index.html new file mode 100644 index 0000000..bb4cc32 --- /dev/null +++ b/mod4/myspringproject/src/main/resources/static/index.html @@ -0,0 +1,21 @@ + + + + Getting Started: Serving Web Content + + + +

this is my first spring boot!

+
+
  • Get your greeting here.
  • +
  • + click to make errors apere!!! +
  • + + + \ No newline at end of file diff --git a/mod4/myspringproject/src/main/resources/templates/error.html b/mod4/myspringproject/src/main/resources/templates/error.html new file mode 100644 index 0000000..00cd423 --- /dev/null +++ b/mod4/myspringproject/src/main/resources/templates/error.html @@ -0,0 +1,22 @@ + + + + What the HECK! + + +

    + 2022-06-01 12:04:47.975 INFO 47920 --- [ restartedMain] c.b.m.MyspringprojectApplication : Starting MyspringprojectApplication using Java 11.0.15 on bhima-Lenovo-ideapad-310-Touch-15ISK with PID 47920 (/home/bhima/dev/mod4/myspringproject/target/classes started by bhima in /home/bhima/dev/mod4/myspringproject) + 2022-06-01 12:04:47.976 INFO 47920 --- [ restartedMain] c.b.m.MyspringprojectApplication : No active profile set, falling back to default profiles: default + 2022-06-01 12:04:48.444 INFO 47920 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): ${name} (http) + 2022-06-01 12:04:48.447 INFO 47920 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] + 2022-06-01 12:04:48.448 INFO 47920 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.56] + 2022-06-01 12:04:48.463 INFO 47920 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext + 2022-06-01 12:04:48.464 INFO 47920 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 482 ms + 2022-06-01 12:04:48.577 INFO 47920 --- [ restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html] + 2022-06-01 12:04:48.640 INFO 47920 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 + 2022-06-01 12:04:48.680 INFO 47920 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' + 2022-06-01 12:04:48.691 INFO 47920 --- [ restartedMain] c.b.m.MyspringprojectApplication : Started MyspringprojectApplication in 0.763 seconds (JVM running for 1725.67) + 2022-06-01 12:04:48.697 INFO 47920 --- [ restartedMain] .ConditionEvaluationDeltaLoggingListener : Condition evaluation unchanged +

    + + \ No newline at end of file diff --git a/mod4/myspringproject/src/main/resources/templates/greeting.html b/mod4/myspringproject/src/main/resources/templates/greeting.html new file mode 100644 index 0000000..6ec386d --- /dev/null +++ b/mod4/myspringproject/src/main/resources/templates/greeting.html @@ -0,0 +1,10 @@ + + + + Getting Started: Serving Web Content + + + +

    + + diff --git a/mod4/myspringproject/src/test/java/com/bhima/myspringproject/MyspringprojectApplicationTests.java b/mod4/myspringproject/src/test/java/com/bhima/myspringproject/MyspringprojectApplicationTests.java new file mode 100644 index 0000000..c747228 --- /dev/null +++ b/mod4/myspringproject/src/test/java/com/bhima/myspringproject/MyspringprojectApplicationTests.java @@ -0,0 +1,13 @@ +package com.bhima.myspringproject; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class MyspringprojectApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/mod4/randomWord/.vscode/settings.json b/mod4/randomWord/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/mod4/randomWord/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/mod4/randomWord/README.md b/mod4/randomWord/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/mod4/randomWord/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/mod4/randomWord/java b/mod4/randomWord/java new file mode 100644 index 0000000..e69de29 diff --git a/mod4/randomWord/json b/mod4/randomWord/json new file mode 100644 index 0000000..e69de29 diff --git a/mod4/randomWord/random word.jar b/mod4/randomWord/random word.jar new file mode 100644 index 0000000000000000000000000000000000000000..8fe453cabdd4d402f267cacf529afae39a26f1e2 GIT binary patch literal 1482 zcmZ{kc{CIV9LL8onQ2puajZ#9bT~&@auuT-V~lgiAV)M9xsOeBXeZGu7b--$1%(hwqfK^O;n-yAJqgxcMuF~1wRc5c*r!~%7!L+yc zMs}jqG??}wYRAWUlRQCyEm{PW1;R_HZF{S1x9#`DBmYSRZ-0>?AsXJ7y~4wxY$jBi@Vt$0Pj zxZJ*gKj{rFVyB~c(Z%KuWiub(i~C#R?Z`te?TrlhNSK3ZVyZxYt1RV?nbQ;$ z=XO@PYN33=(=Q9`jMtHkH%^Zm4!vW1Jg~C*fk{c-q(yAlGr!fo`Pa@jZ^K8TPtWFD zgRy@i@wFE*mx_$f(p~_NWhr#`kCJN>dC<+Jygmo}l{AlwR7o_DfQ}lGvw8mqvvh`X zE(c)3HuwB%+9Ky}6un=CSPFT1);Y3_Qgb^_+qo@lPlr|adworKkEl8pN8_>k1E{9% zRdzzK5c%E?$+GI)v?0;dfg3Mb-F4siR1p45Fwd{5JdNl;Z*Banp#!@Da22L~$dCf! z%~gorwN+7XC(k6vuzZ@ktQ=oRFzeQc0rdS*_oHihNA&dqEhAFXAmkK#2-v=aldp7t z{-|6EA6{@|J>{zs6J^+9SIfEHgG^LXR;(X5tcuJuwSG*VwpdGFf&AP92kT@Ux0pr= zL4awh^=G6_6Olbsj;6oGq^7^~q<>EWr;PR*l27|$2pbVul#$a4Ie3iyN-tm_iN`M!yj( zs?NuDgr6x~la-nZdNJ)L+z|m=Prj=6=F?~Ql$Z1Z4a4Mn<6EKxoG%E?|1v&%RA2! z>vLJ((*28ycfK2%hNSIdO`% zEHV$%UscJQ+E`-w2;ARl@Z;Evi+hqrayAyU`_(Nga>vuHT TqJevMUV__oZF`;q?p*%>56y`& literal 0 HcmV?d00001 diff --git a/mod4/randomWord/src/App.java b/mod4/randomWord/src/App.java new file mode 100644 index 0000000..790395f --- /dev/null +++ b/mod4/randomWord/src/App.java @@ -0,0 +1,111 @@ +import java.util.Random; + +public class App { + public static void main(String[] args) throws Exception { + Random random = new Random(); + System.out.println(getWord(random)); + } + + private static String getWord(Random random) { + int times = randomNum(random, 10) + 1; + String word = ""; + for (int i = 0; i < times; i++) { + word = word + numToWord(randomNum(random, 27)); + } + + return word; + } + + private static String numToWord(int num) { + + switch (num) { + case 0: + return "a"; + case 1: + + return "b"; + case 2: + + return "c"; + case 3: + + return "d"; + case 4: + + return "e"; + case 5: + + return "f"; + case 6: + + return "g"; + case 7: + + return "h"; + case 8: + + return "i"; + case 9: + + return "j"; + case 10: + + return "k"; + case 11: + + return "l"; + case 12: + + return "m"; + case 13: + + return "n"; + case 14: + + return "o"; + case 15: + + return "p"; + case 16: + + return "q"; + case 17: + + return "r"; + case 18: + + return "s"; + case 19: + + return "t"; + case 20: + + return "u"; + case 21: + + return "v"; + case 22: + + return "w"; + case 23: + + return "x"; + case 24: + + return "y"; + case 25: + + return "z"; + case 26: + + return " "; + case 27: + return ""; + } + return null; + } + + private static int randomNum(Random random, int bound) { + return random.nextInt(bound); + } +} diff --git a/mod4/randomWord/src/RandomWord.java b/mod4/randomWord/src/RandomWord.java new file mode 100644 index 0000000..ab55975 --- /dev/null +++ b/mod4/randomWord/src/RandomWord.java @@ -0,0 +1,111 @@ +import java.util.Random; + +public class RandomWord { + private Random random; + public RandomWord(Random random){ + this.random = random; + } + + public String getWord() { + int times = this.randomNum(this.random, 12) + 1; + String word = ""; + for (int i = 0; i < times; i++) { + word = word + this.numToWord(randomNum(this.random, 27)); + } + + return word; + } + + private String numToWord(int num) { + + switch (num) { + case 0: + return "a"; + case 1: + + return "b"; + case 2: + + return "c"; + case 3: + + return "d"; + case 4: + + return "e"; + case 5: + + return "f"; + case 6: + + return "g"; + case 7: + + return "h"; + case 8: + + return "i"; + case 9: + + return "j"; + case 10: + + return "k"; + case 11: + + return "l"; + case 12: + + return "m"; + case 13: + + return "n"; + case 14: + + return "o"; + case 15: + + return "p"; + case 16: + + return "q"; + case 17: + + return "r"; + case 18: + + return "s"; + case 19: + + return "t"; + case 20: + + return "u"; + case 21: + + return "v"; + case 22: + + return "w"; + case 23: + + return "x"; + case 24: + + return "y"; + case 25: + + return "z"; + case 26: + + return " "; + case 27: + return ""; + } + return null; + } + + private int randomNum(Random random, int bound) { + return random.nextInt(bound); + } +} diff --git a/mod4/rats/.vscode/settings.json b/mod4/rats/.vscode/settings.json index 779a1b4..d71dfa0 100644 --- a/mod4/rats/.vscode/settings.json +++ b/mod4/rats/.vscode/settings.json @@ -1,4 +1,4 @@ { - "java.configuration.updateBuildConfiguration": "interactive", + "java.configuration.updateBuildConfiguration": "automatic", "maven.view": "flat" } \ No newline at end of file diff --git a/mod4/rats/pom.xml b/mod4/rats/pom.xml index 8e27964..035aef9 100644 --- a/mod4/rats/pom.xml +++ b/mod4/rats/pom.xml @@ -1,7 +1,6 @@ - + 4.0.0 com.text @@ -25,10 +24,16 @@ 4.11 test + + org.springframework + spring-context + 5.3.20 + - + + @@ -72,4 +77,4 @@ - + \ No newline at end of file diff --git a/mod4/rats/src/main/applicationContext.xml b/mod4/rats/src/main/applicationContext.xml new file mode 100644 index 0000000..bd4594a --- /dev/null +++ b/mod4/rats/src/main/applicationContext.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/mod4/rats/src/main/java/com/text/GreateParty.java b/mod4/rats/src/main/java/com/text/App.java similarity index 96% rename from mod4/rats/src/main/java/com/text/GreateParty.java rename to mod4/rats/src/main/java/com/text/App.java index 208b757..7798015 100644 --- a/mod4/rats/src/main/java/com/text/GreateParty.java +++ b/mod4/rats/src/main/java/com/text/App.java @@ -1,6 +1,6 @@ package com.text; -public class GreateParty { +public class App { // When squirrels get together for a party, they like to have cigars. // A squirrel party is successful when the number of cigars is between // 40 and 60, inclusive. Unless it is the weekend, in which case there diff --git a/mod4/rats/src/test/java/com/text/GreatePartyTest.java b/mod4/rats/src/test/java/com/text/GreatePartyTest.java index b8fcc24..fa27c89 100644 --- a/mod4/rats/src/test/java/com/text/GreatePartyTest.java +++ b/mod4/rats/src/test/java/com/text/GreatePartyTest.java @@ -1,47 +1,5 @@ package com.text; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - public class GreatePartyTest { - GreateParty party = new GreateParty(); - - public GreatePartyTest() { - } - - @BeforeClass - public static void setUpClass() { - - } - - @AfterClass - public static void tearDownClass() { - - } - - @Before - public void setUp() { - - } - - @After - public void tearDown() { - - } - - @Test - public void test30False() { - assertFalse(party.greatParty(30, false)); - } - - @Test - public void test50False() { - assertTrue(party.greatParty(50, false)); - } + } diff --git a/mod4/server of the gods/.vscode/settings.json b/mod4/server of the gods/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/mod4/server of the gods/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/mod4/server of the gods/README.md b/mod4/server of the gods/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/mod4/server of the gods/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/mod4/server of the gods/src/App.java b/mod4/server of the gods/src/App.java new file mode 100644 index 0000000..a21cba8 --- /dev/null +++ b/mod4/server of the gods/src/App.java @@ -0,0 +1,7 @@ +import java.util.Random; + +public class App { + public static void main(String[] args) throws Exception { + RandomWord foo = new RandomWord(new Random()); + } +} diff --git a/mod4/server of the gods/src/dao/DaoMemoryImpl.java b/mod4/server of the gods/src/dao/DaoMemoryImpl.java new file mode 100644 index 0000000..d57c431 --- /dev/null +++ b/mod4/server of the gods/src/dao/DaoMemoryImpl.java @@ -0,0 +1,76 @@ +package dao; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import interfaces.dao; +import modle.Server; + +public class DaoMemoryImpl implements dao { + + private Map serverMap = new HashMap<>(); + + @Override + public void addServer(Server server) { + serverMap.put(server.getName(), server); + } + + @Override + public Server getServer(String name) { + return serverMap.get(name); + } + + @Override + public void removeServer(String name) { + serverMap.remove(name); + } + + @Override + public List getAllServers() { + return new ArrayList(serverMap.values()); + } + + @Override + public Map> getAllServersGroupByManufacturer() { + return serverMap.values() + .stream() + .collect(Collectors.groupingBy(Server::getManufacturer)); + } + + @Override + public List getServersByManufacturer(String manufacturer) { + return serverMap.values() + .stream() + .filter(s -> s.getManufacturer().equalsIgnoreCase(manufacturer)) + .collect(Collectors.toList()); + } + + @Override + public List getServersOlderThan(int ageInYears) { + return serverMap.values() + .stream() + .filter(s -> s.getServerAge() > ageInYears) + .collect(Collectors.toList()); + } + + @Override + public Map> getServersOlderThanGroupByManufacturer(int ageInYears) { + return this.getServersOlderThan(ageInYears) + .stream() + .collect(Collectors.groupingBy(Server::getManufacturer)); + } + + @Override + public double getAverageServerAge() { + return serverMap.values() + .stream() + .mapToLong(s -> s.getServerAge()) + // .mapToLong(Server::getServerAge) + .average() + .getAsDouble(); + } + +} diff --git a/mod4/server of the gods/src/interfaces/dao.java b/mod4/server of the gods/src/interfaces/dao.java new file mode 100644 index 0000000..c446db1 --- /dev/null +++ b/mod4/server of the gods/src/interfaces/dao.java @@ -0,0 +1,18 @@ +package interfaces; + +import java.util.List; +import java.util.Map; + +import modle.Server; + +public interface dao { + public void addServer(Server server); + public Server getServer(String name); + public void removeServer(String name); + public List getAllServers(); + public Map> getAllServersGroupByManufacturer(); + public List getServersByManufacturer(String manufacturer); + public List getServersOlderThan(int ageInYears); + public Map> getServersOlderThanGroupByManufacturer(int ageInYears); + public double getAverageServerAge(); +} diff --git a/mod4/server of the gods/src/modle/Server.java b/mod4/server of the gods/src/modle/Server.java new file mode 100644 index 0000000..89855ae --- /dev/null +++ b/mod4/server of the gods/src/modle/Server.java @@ -0,0 +1,75 @@ +package modle; + +import java.time.LocalDate; +import java.time.Period; + +public class Server { + private String name; + private String ip; + private String manufacturer; + private int ram; + private int numProcessors; + private LocalDate purchaseDate; + + public Server(String name, String ip, String manufacturer, int ram, int numProcessors, LocalDate purchaseDate){ + this.setIp(ip); + this.setManufacturer(manufacturer); + this.setNumProcessors(numProcessors); + this.setPurchaseDate(purchaseDate); + this.setRam(ram); + this.setName(name); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public int getRam() { + return ram; + } + + public void setRam(int ram) { + this.ram = ram; + } + + public int getNumProcessors() { + return numProcessors; + } + + public void setNumProcessors(int numProcessors) { + this.numProcessors = numProcessors; + } + + public LocalDate getPurchaseDate() { + return purchaseDate; + } + + public void setPurchaseDate(LocalDate purchaseDate) { + this.purchaseDate = purchaseDate; + } + + public long getServerAge() { + Period p = purchaseDate.until(LocalDate.now()); + return p.getYears(); + } +}

    jdk!