From 63e3f09a487b528e350ab2ac9adba40b7a765003 Mon Sep 17 00:00:00 2001 From: Hammy Date: Thu, 3 Dec 2020 21:38:18 +0000 Subject: [PATCH] Complete Refactor of File Directories --- .gitignore | 18 ++++++----- .../src => src/arrays}/SimpleArrays.java | 2 ++ .../conditionals}/ConditionalStatements.java | 2 ++ .../src => src/scanner}/UsingScanner.java | 2 ++ .../strings}/WorkingWithStrings.java | 2 ++ Design Patterns/src/singleton/Main.java | 14 +++++++++ .../src/singleton/SingleObject.java | 17 +++++++++++ .../interfaces/animals}/Animal.java | 2 +- .../interfaces/animals}/AnimalHelper.java | 2 +- .../interfaces/animals}/AnimalMain.java | 2 +- .../src => src/interfaces/animals}/Cat.java | 2 +- .../src => src/interfaces/animals}/Cow.java | 2 +- .../src => src/interfaces/animals}/Dog.java | 2 +- .../src => src/interfaces/animals}/Horse.java | 2 +- .../interfaces/counter}/ByFives.java | 2 +- .../interfaces/counter}/ByFours.java | 2 +- .../interfaces/counter}/ByOnes.java | 2 +- .../interfaces/counter}/ByThrees.java | 2 +- .../interfaces/counter}/ByTwos.java | 2 +- .../interfaces/counter}/Counter.java | 2 +- .../interfaces/counter}/CounterHelper.java | 2 +- .../interfaces/counter}/CounterMain.java | 2 +- .../pluralsite/calculatorengine}/Adder.java | 2 +- .../calculatorengine}/CalculateBase.java | 2 +- .../pluralsite/calculatorengine}/Divider.java | 2 +- .../calculatorengine}/DynamicHelper.java | 2 +- .../calculatorengine}/MathEquation.java | 2 +- .../calculatorengine}/MathOperation.java | 2 +- .../calculatorengine}/MathProcessing.java | 2 +- .../calculatorengine}/Multiplier.java | 2 +- .../calculatorengine}/NewCalcEngine.java | 2 +- .../pluralsite/calculatorengine}/PowerOf.java | 2 +- .../calculatorengine}/Subtractor.java | 2 +- .../pluralsite/getorganised/GetOrganised.java | 7 ----- .../calculatorengine}/CalcEngine.java | 20 +++++++------ .../src => src/helloworld}/HelloWorld.java | 2 ++ .../OperatorPrecedence.java | 2 ++ .../pluralsite/getorganised/GetOrganised.java | 7 +++++ Java Sets/src/common/Product.java | 28 ++++++++++++++++++ Java Sets/src/common/Supplier.java | 26 ++++++++++++++++ Personal/Anagram/.idea/.gitignore | 8 ----- Personal/Anagram/.idea/aws.xml | 11 ------- Personal/Anagram/.idea/discord.xml | 6 ---- Personal/Anagram/.idea/misc.xml | 6 ---- Personal/Anagram/.idea/modules.xml | 8 ----- Personal/Anagram/.idea/vcs.xml | 6 ---- Personal/Anagram/Anagram.iml | 11 ------- .../out/production/Anagram/.idea/.gitignore | 8 ----- .../out/production/Anagram/.idea/aws.xml | 11 ------- .../out/production/Anagram/.idea/misc.xml | 6 ---- .../out/production/Anagram/.idea/modules.xml | 8 ----- .../out/production/Anagram/.idea/vcs.xml | 6 ---- .../out/production/Anagram/Anagram.iml | 11 ------- .../Anagram/src/AnagramGenerator.class | Bin 2775 -> 0 bytes .../target/classes/hello/world/Greeting.class | Bin 783 -> 0 bytes .../classes/hello/world/HelloWorld.class | Bin 591 -> 0 bytes .../src => src/anagram}/AnagramGenerator.java | 4 +-- Personal/{Cards/src => src/cards}/Card.java | 2 ++ .../{Cards/src => src/cards}/CardMain.java | 2 ++ Personal/{Cards/src => src/cards}/Deck.java | 8 +++-- Personal/{Cards/src => src/cards}/Faces.java | 2 ++ Personal/{Cards/src => src/cards}/Hand.java | 16 +++++----- Personal/{Cards/src => src/cards}/Player.java | 6 ++-- Personal/{Cards/src => src/cards}/Sevens.java | 16 +++++----- Personal/{Cards/src => src/cards}/Suits.java | 2 ++ .../{Cards/src => src/cards}/TableHand.java | 4 ++- .../src => src/oop}/Coordinates.java | 2 ++ .../src => src/oop}/Equation.java | 2 ++ .../src => src/oop}/Line.java | 2 ++ .../src => src/oop}/Main.java | 2 ++ .../tdd/helloworld}/.idea/.gitignore | 0 .../tdd/helloworld}/.idea/.name | 0 .../tdd/helloworld}/.idea/compiler.xml | 0 .../tdd/helloworld}/.idea/encodings.xml | 0 .../libraries/Maven__junit_junit_4_11.xml | 0 .../Maven__org_hamcrest_hamcrest_core_1_3.xml | 0 .../tdd/helloworld}/.idea/misc.xml | 0 .../tdd/helloworld}/.idea/modules.xml | 0 .../tdd/helloworld}/.idea/vcs.xml | 0 .../tdd/helloworld}/lib/hamcrest-core-1.3.jar | Bin .../tdd/helloworld}/lib/junit-4.12.jar | Bin .../src/main/java/hello/world/Greeting.java | 2 +- .../src/main/java/hello/world/HelloWorld.java | 2 +- .../test/java/hello/world/HelloWorldTest.java | 7 +++-- 84 files changed, 204 insertions(+), 184 deletions(-) rename 2018 - 2019/{Arrays/src => src/arrays}/SimpleArrays.java (97%) rename 2018 - 2019/{Conditionals/src => src/conditionals}/ConditionalStatements.java (98%) rename 2018 - 2019/{Using Scanner/src => src/scanner}/UsingScanner.java (98%) rename 2018 - 2019/{Working With Strings/src => src/strings}/WorkingWithStrings.java (99%) create mode 100644 Design Patterns/src/singleton/Main.java create mode 100644 Design Patterns/src/singleton/SingleObject.java rename Java Classes & Interfaces/{Interfaces/Animals/src => src/interfaces/animals}/Animal.java (80%) rename Java Classes & Interfaces/{Interfaces/Animals/src => src/interfaces/animals}/AnimalHelper.java (97%) rename Java Classes & Interfaces/{Interfaces/Animals/src => src/interfaces/animals}/AnimalMain.java (94%) rename Java Classes & Interfaces/{Interfaces/Animals/src => src/interfaces/animals}/Cat.java (90%) rename Java Classes & Interfaces/{Interfaces/Animals/src => src/interfaces/animals}/Cow.java (90%) rename Java Classes & Interfaces/{Interfaces/Animals/src => src/interfaces/animals}/Dog.java (90%) rename Java Classes & Interfaces/{Interfaces/Animals/src => src/interfaces/animals}/Horse.java (90%) rename Java Classes & Interfaces/{Interfaces/Counter/src => src/interfaces/counter}/ByFives.java (89%) rename Java Classes & Interfaces/{Interfaces/Counter/src => src/interfaces/counter}/ByFours.java (89%) rename Java Classes & Interfaces/{Interfaces/Counter/src => src/interfaces/counter}/ByOnes.java (89%) rename Java Classes & Interfaces/{Interfaces/Counter/src => src/interfaces/counter}/ByThrees.java (90%) rename Java Classes & Interfaces/{Interfaces/Counter/src => src/interfaces/counter}/ByTwos.java (89%) rename Java Classes & Interfaces/{Interfaces/Counter/src => src/interfaces/counter}/Counter.java (73%) rename Java Classes & Interfaces/{Interfaces/Counter/src => src/interfaces/counter}/CounterHelper.java (97%) rename Java Classes & Interfaces/{Interfaces/Counter/src => src/interfaces/counter}/CounterMain.java (97%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/Adder.java (94%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/CalculateBase.java (95%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/Divider.java (88%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/DynamicHelper.java (96%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/MathEquation.java (98%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/MathOperation.java (63%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/MathProcessing.java (85%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/Multiplier.java (88%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/NewCalcEngine.java (99%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/PowerOf.java (93%) rename Java Classes & Interfaces/{Pluralsite/New Calc Engine/src => src/pluralsite/calculatorengine}/Subtractor.java (88%) delete mode 100644 Java Fundamentals/Get Organised/src/com/pluralsite/getorganised/GetOrganised.java rename Java Fundamentals/{Calc Engine/src => src/calculatorengine}/CalcEngine.java (94%) rename Java Fundamentals/{Hello World/src => src/helloworld}/HelloWorld.java (85%) rename Java Fundamentals/{Operator Precedence/src => src/operatorprecedence}/OperatorPrecedence.java (92%) create mode 100644 Java Fundamentals/src/organised/com/pluralsite/getorganised/GetOrganised.java create mode 100644 Java Sets/src/common/Product.java create mode 100644 Java Sets/src/common/Supplier.java delete mode 100644 Personal/Anagram/.idea/.gitignore delete mode 100644 Personal/Anagram/.idea/aws.xml delete mode 100644 Personal/Anagram/.idea/discord.xml delete mode 100644 Personal/Anagram/.idea/misc.xml delete mode 100644 Personal/Anagram/.idea/modules.xml delete mode 100644 Personal/Anagram/.idea/vcs.xml delete mode 100644 Personal/Anagram/Anagram.iml delete mode 100644 Personal/Anagram/out/production/Anagram/.idea/.gitignore delete mode 100644 Personal/Anagram/out/production/Anagram/.idea/aws.xml delete mode 100644 Personal/Anagram/out/production/Anagram/.idea/misc.xml delete mode 100644 Personal/Anagram/out/production/Anagram/.idea/modules.xml delete mode 100644 Personal/Anagram/out/production/Anagram/.idea/vcs.xml delete mode 100644 Personal/Anagram/out/production/Anagram/Anagram.iml delete mode 100644 Personal/Anagram/out/production/Anagram/src/AnagramGenerator.class delete mode 100644 Personal/Test Driven Development/Hello World/target/classes/hello/world/Greeting.class delete mode 100644 Personal/Test Driven Development/Hello World/target/classes/hello/world/HelloWorld.class rename Personal/{Anagram/src => src/anagram}/AnagramGenerator.java (98%) rename Personal/{Cards/src => src/cards}/Card.java (96%) rename Personal/{Cards/src => src/cards}/CardMain.java (97%) rename Personal/{Cards/src => src/cards}/Deck.java (84%) rename Personal/{Cards/src => src/cards}/Faces.java (94%) rename Personal/{Cards/src => src/cards}/Hand.java (77%) rename Personal/{Cards/src => src/cards}/Player.java (81%) rename Personal/{Cards/src => src/cards}/Sevens.java (89%) rename Personal/{Cards/src => src/cards}/Suits.java (93%) rename Personal/{Cards/src => src/cards}/TableHand.java (88%) rename Personal/{SimpleOOPExample/src => src/oop}/Coordinates.java (96%) rename Personal/{SimpleOOPExample/src => src/oop}/Equation.java (80%) rename Personal/{SimpleOOPExample/src => src/oop}/Line.java (98%) rename Personal/{SimpleOOPExample/src => src/oop}/Main.java (96%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/.idea/.gitignore (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/.idea/.name (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/.idea/compiler.xml (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/.idea/encodings.xml (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/.idea/libraries/Maven__junit_junit_4_11.xml (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/.idea/misc.xml (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/.idea/modules.xml (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/.idea/vcs.xml (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/lib/hamcrest-core-1.3.jar (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/lib/junit-4.12.jar (100%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/src/main/java/hello/world/Greeting.java (85%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/src/main/java/hello/world/HelloWorld.java (81%) rename Personal/{Test Driven Development/Hello World => src/tdd/helloworld}/src/test/java/hello/world/HelloWorldTest.java (68%) diff --git a/.gitignore b/.gitignore index c23bb98..070b34e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,15 +2,17 @@ 2018 - 2019/.DS_Store Java Fundamentals/.DS_Store Java Classes & Interfaces/.DS_Store -Learning Java.code-workspace -Personal/Test Driven Development/Hello World/.classpath .vscode/settings.json -Personal/Test Driven Development/Hello World/.project -Personal/Test Driven Development/Hello World/pom.xml -Personal/Test Driven Development/Hello World/.settings/org.eclipse.core.resources.prefs -Personal/Test Driven Development/Hello World/.settings/org.eclipse.jdt.apt.core.prefs -Personal/Test Driven Development/Hello World/.settings/org.eclipse.jdt.core.prefs -Personal/Test Driven Development/Hello World/.settings/org.eclipse.m2e.core.prefs /.idea/ /out/ /Java Streams/Java Streams.iml +/2018 - 2019/2018 - 2019.iml +/Design Patterns/Design Patterns.iml +/Java Classes & Interfaces/Java Classes & Interfaces.iml +/Java Collections/Java Collections.iml +/Learning-Java.iml +/Personal/Personal.iml +/Personal/src/tdd/helloworld/HelloWorld.iml +/Java Fundamentals/Java Fundamentals.iml +/Java Sets/Java Sets.iml +/Personal/src/tdd/helloworld/pom.xml diff --git a/2018 - 2019/Arrays/src/SimpleArrays.java b/2018 - 2019/src/arrays/SimpleArrays.java similarity index 97% rename from 2018 - 2019/Arrays/src/SimpleArrays.java rename to 2018 - 2019/src/arrays/SimpleArrays.java index b83b014..a33cf18 100644 --- a/2018 - 2019/Arrays/src/SimpleArrays.java +++ b/2018 - 2019/src/arrays/SimpleArrays.java @@ -1,3 +1,5 @@ +package arrays; + import java.util.Scanner; public class SimpleArrays { diff --git a/2018 - 2019/Conditionals/src/ConditionalStatements.java b/2018 - 2019/src/conditionals/ConditionalStatements.java similarity index 98% rename from 2018 - 2019/Conditionals/src/ConditionalStatements.java rename to 2018 - 2019/src/conditionals/ConditionalStatements.java index ed289b6..c31cf8c 100644 --- a/2018 - 2019/Conditionals/src/ConditionalStatements.java +++ b/2018 - 2019/src/conditionals/ConditionalStatements.java @@ -1,3 +1,5 @@ +package conditionals; + import java.util.Scanner; public class ConditionalStatements { diff --git a/2018 - 2019/Using Scanner/src/UsingScanner.java b/2018 - 2019/src/scanner/UsingScanner.java similarity index 98% rename from 2018 - 2019/Using Scanner/src/UsingScanner.java rename to 2018 - 2019/src/scanner/UsingScanner.java index ce76cd6..a3115b6 100644 --- a/2018 - 2019/Using Scanner/src/UsingScanner.java +++ b/2018 - 2019/src/scanner/UsingScanner.java @@ -1,3 +1,5 @@ +package scanner; + import java.util.Scanner; public class UsingScanner { diff --git a/2018 - 2019/Working With Strings/src/WorkingWithStrings.java b/2018 - 2019/src/strings/WorkingWithStrings.java similarity index 99% rename from 2018 - 2019/Working With Strings/src/WorkingWithStrings.java rename to 2018 - 2019/src/strings/WorkingWithStrings.java index f978f40..5f5adbb 100644 --- a/2018 - 2019/Working With Strings/src/WorkingWithStrings.java +++ b/2018 - 2019/src/strings/WorkingWithStrings.java @@ -1,3 +1,5 @@ +package strings; + import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Arrays; diff --git a/Design Patterns/src/singleton/Main.java b/Design Patterns/src/singleton/Main.java new file mode 100644 index 0000000..cbddb6e --- /dev/null +++ b/Design Patterns/src/singleton/Main.java @@ -0,0 +1,14 @@ +package singleton; + +public class Main { + public static void main(String[] args) { + + // Illegal construct + // Compile Time Error: The constructor SingleObject() is not visible + // SingleObject object = new SingleObject(); + + SingleObject singleObject = SingleObject.getInstance(); + singleObject.showMessage(); + + } +} diff --git a/Design Patterns/src/singleton/SingleObject.java b/Design Patterns/src/singleton/SingleObject.java new file mode 100644 index 0000000..3939890 --- /dev/null +++ b/Design Patterns/src/singleton/SingleObject.java @@ -0,0 +1,17 @@ +package singleton; + +public class SingleObject { + + private static final SingleObject instance = new SingleObject(); + + private SingleObject() { + } + + public static SingleObject getInstance() { + return instance; + } + + public void showMessage() { + System.out.println("Hello World!"); + } +} diff --git a/Java Classes & Interfaces/Interfaces/Animals/src/Animal.java b/Java Classes & Interfaces/src/interfaces/animals/Animal.java similarity index 80% rename from Java Classes & Interfaces/Interfaces/Animals/src/Animal.java rename to Java Classes & Interfaces/src/interfaces/animals/Animal.java index ae9a50c..0da51a1 100644 --- a/Java Classes & Interfaces/Interfaces/Animals/src/Animal.java +++ b/Java Classes & Interfaces/src/interfaces/animals/Animal.java @@ -1,4 +1,4 @@ -package src; +package interfaces.animals; public interface Animal { diff --git a/Java Classes & Interfaces/Interfaces/Animals/src/AnimalHelper.java b/Java Classes & Interfaces/src/interfaces/animals/AnimalHelper.java similarity index 97% rename from Java Classes & Interfaces/Interfaces/Animals/src/AnimalHelper.java rename to Java Classes & Interfaces/src/interfaces/animals/AnimalHelper.java index 299e23e..3d1374c 100644 --- a/Java Classes & Interfaces/Interfaces/Animals/src/AnimalHelper.java +++ b/Java Classes & Interfaces/src/interfaces/animals/AnimalHelper.java @@ -1,4 +1,4 @@ -package src; +package interfaces.animals; public class AnimalHelper { diff --git a/Java Classes & Interfaces/Interfaces/Animals/src/AnimalMain.java b/Java Classes & Interfaces/src/interfaces/animals/AnimalMain.java similarity index 94% rename from Java Classes & Interfaces/Interfaces/Animals/src/AnimalMain.java rename to Java Classes & Interfaces/src/interfaces/animals/AnimalMain.java index a2e158b..ce47dc3 100644 --- a/Java Classes & Interfaces/Interfaces/Animals/src/AnimalMain.java +++ b/Java Classes & Interfaces/src/interfaces/animals/AnimalMain.java @@ -1,4 +1,4 @@ -package src; +package interfaces.animals; public class AnimalMain { public static void main(String[] args) { diff --git a/Java Classes & Interfaces/Interfaces/Animals/src/Cat.java b/Java Classes & Interfaces/src/interfaces/animals/Cat.java similarity index 90% rename from Java Classes & Interfaces/Interfaces/Animals/src/Cat.java rename to Java Classes & Interfaces/src/interfaces/animals/Cat.java index 427dda4..3d8c807 100644 --- a/Java Classes & Interfaces/Interfaces/Animals/src/Cat.java +++ b/Java Classes & Interfaces/src/interfaces/animals/Cat.java @@ -1,4 +1,4 @@ -package src; +package interfaces.animals; public class Cat implements Animal { diff --git a/Java Classes & Interfaces/Interfaces/Animals/src/Cow.java b/Java Classes & Interfaces/src/interfaces/animals/Cow.java similarity index 90% rename from Java Classes & Interfaces/Interfaces/Animals/src/Cow.java rename to Java Classes & Interfaces/src/interfaces/animals/Cow.java index bc36e69..1955182 100644 --- a/Java Classes & Interfaces/Interfaces/Animals/src/Cow.java +++ b/Java Classes & Interfaces/src/interfaces/animals/Cow.java @@ -1,4 +1,4 @@ -package src; +package interfaces.animals; public class Cow implements Animal { diff --git a/Java Classes & Interfaces/Interfaces/Animals/src/Dog.java b/Java Classes & Interfaces/src/interfaces/animals/Dog.java similarity index 90% rename from Java Classes & Interfaces/Interfaces/Animals/src/Dog.java rename to Java Classes & Interfaces/src/interfaces/animals/Dog.java index 3a37d58..5c72f01 100644 --- a/Java Classes & Interfaces/Interfaces/Animals/src/Dog.java +++ b/Java Classes & Interfaces/src/interfaces/animals/Dog.java @@ -1,4 +1,4 @@ -package src; +package interfaces.animals; public class Dog implements Animal { diff --git a/Java Classes & Interfaces/Interfaces/Animals/src/Horse.java b/Java Classes & Interfaces/src/interfaces/animals/Horse.java similarity index 90% rename from Java Classes & Interfaces/Interfaces/Animals/src/Horse.java rename to Java Classes & Interfaces/src/interfaces/animals/Horse.java index 548140e..ca6f123 100644 --- a/Java Classes & Interfaces/Interfaces/Animals/src/Horse.java +++ b/Java Classes & Interfaces/src/interfaces/animals/Horse.java @@ -1,4 +1,4 @@ -package src; +package interfaces.animals; public class Horse implements Animal { diff --git a/Java Classes & Interfaces/Interfaces/Counter/src/ByFives.java b/Java Classes & Interfaces/src/interfaces/counter/ByFives.java similarity index 89% rename from Java Classes & Interfaces/Interfaces/Counter/src/ByFives.java rename to Java Classes & Interfaces/src/interfaces/counter/ByFives.java index 13fd11e..b7d9472 100644 --- a/Java Classes & Interfaces/Interfaces/Counter/src/ByFives.java +++ b/Java Classes & Interfaces/src/interfaces/counter/ByFives.java @@ -1,4 +1,4 @@ -package src; +package interfaces.counter; public class ByFives implements Counter { diff --git a/Java Classes & Interfaces/Interfaces/Counter/src/ByFours.java b/Java Classes & Interfaces/src/interfaces/counter/ByFours.java similarity index 89% rename from Java Classes & Interfaces/Interfaces/Counter/src/ByFours.java rename to Java Classes & Interfaces/src/interfaces/counter/ByFours.java index 559e878..a086b54 100644 --- a/Java Classes & Interfaces/Interfaces/Counter/src/ByFours.java +++ b/Java Classes & Interfaces/src/interfaces/counter/ByFours.java @@ -1,4 +1,4 @@ -package src; +package interfaces.counter; public class ByFours implements Counter { diff --git a/Java Classes & Interfaces/Interfaces/Counter/src/ByOnes.java b/Java Classes & Interfaces/src/interfaces/counter/ByOnes.java similarity index 89% rename from Java Classes & Interfaces/Interfaces/Counter/src/ByOnes.java rename to Java Classes & Interfaces/src/interfaces/counter/ByOnes.java index cf48515..2fdb9b5 100644 --- a/Java Classes & Interfaces/Interfaces/Counter/src/ByOnes.java +++ b/Java Classes & Interfaces/src/interfaces/counter/ByOnes.java @@ -1,4 +1,4 @@ -package src; +package interfaces.counter; public class ByOnes implements Counter { diff --git a/Java Classes & Interfaces/Interfaces/Counter/src/ByThrees.java b/Java Classes & Interfaces/src/interfaces/counter/ByThrees.java similarity index 90% rename from Java Classes & Interfaces/Interfaces/Counter/src/ByThrees.java rename to Java Classes & Interfaces/src/interfaces/counter/ByThrees.java index b0d8f7b..43f9393 100644 --- a/Java Classes & Interfaces/Interfaces/Counter/src/ByThrees.java +++ b/Java Classes & Interfaces/src/interfaces/counter/ByThrees.java @@ -1,4 +1,4 @@ -package src; +package interfaces.counter; public class ByThrees implements Counter { diff --git a/Java Classes & Interfaces/Interfaces/Counter/src/ByTwos.java b/Java Classes & Interfaces/src/interfaces/counter/ByTwos.java similarity index 89% rename from Java Classes & Interfaces/Interfaces/Counter/src/ByTwos.java rename to Java Classes & Interfaces/src/interfaces/counter/ByTwos.java index e78024e..151ed77 100644 --- a/Java Classes & Interfaces/Interfaces/Counter/src/ByTwos.java +++ b/Java Classes & Interfaces/src/interfaces/counter/ByTwos.java @@ -1,4 +1,4 @@ -package src; +package interfaces.counter; public class ByTwos implements Counter { diff --git a/Java Classes & Interfaces/Interfaces/Counter/src/Counter.java b/Java Classes & Interfaces/src/interfaces/counter/Counter.java similarity index 73% rename from Java Classes & Interfaces/Interfaces/Counter/src/Counter.java rename to Java Classes & Interfaces/src/interfaces/counter/Counter.java index 2595bae..5337b14 100644 --- a/Java Classes & Interfaces/Interfaces/Counter/src/Counter.java +++ b/Java Classes & Interfaces/src/interfaces/counter/Counter.java @@ -1,4 +1,4 @@ -package src; +package interfaces.counter; public interface Counter { diff --git a/Java Classes & Interfaces/Interfaces/Counter/src/CounterHelper.java b/Java Classes & Interfaces/src/interfaces/counter/CounterHelper.java similarity index 97% rename from Java Classes & Interfaces/Interfaces/Counter/src/CounterHelper.java rename to Java Classes & Interfaces/src/interfaces/counter/CounterHelper.java index 2acec0a..3c91c18 100644 --- a/Java Classes & Interfaces/Interfaces/Counter/src/CounterHelper.java +++ b/Java Classes & Interfaces/src/interfaces/counter/CounterHelper.java @@ -1,4 +1,4 @@ -package src; +package interfaces.counter; public class CounterHelper { diff --git a/Java Classes & Interfaces/Interfaces/Counter/src/CounterMain.java b/Java Classes & Interfaces/src/interfaces/counter/CounterMain.java similarity index 97% rename from Java Classes & Interfaces/Interfaces/Counter/src/CounterMain.java rename to Java Classes & Interfaces/src/interfaces/counter/CounterMain.java index f425d88..7e39947 100644 --- a/Java Classes & Interfaces/Interfaces/Counter/src/CounterMain.java +++ b/Java Classes & Interfaces/src/interfaces/counter/CounterMain.java @@ -1,4 +1,4 @@ -package src; +package interfaces.counter; import java.util.Scanner; diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Adder.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/Adder.java similarity index 94% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Adder.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/Adder.java index 8611bb1..0901a67 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Adder.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/Adder.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public class Adder extends CalculateBase implements MathProcessing { diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/CalculateBase.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/CalculateBase.java similarity index 95% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/CalculateBase.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/CalculateBase.java index 82e0a00..4365590 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/CalculateBase.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/CalculateBase.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public abstract class CalculateBase { private double leftVal; diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Divider.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/Divider.java similarity index 88% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Divider.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/Divider.java index ae83d0d..03a6e83 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Divider.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/Divider.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public class Divider extends CalculateBase { diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/DynamicHelper.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/DynamicHelper.java similarity index 96% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/DynamicHelper.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/DynamicHelper.java index 3cf6f36..4d773d6 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/DynamicHelper.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/DynamicHelper.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public class DynamicHelper { diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/MathEquation.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/MathEquation.java similarity index 98% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/MathEquation.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/MathEquation.java index 16ded90..1598c7e 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/MathEquation.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/MathEquation.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public class MathEquation { private double leftVal; diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/MathOperation.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/MathOperation.java similarity index 63% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/MathOperation.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/MathOperation.java index c9aa4a8..b905a9d 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/MathOperation.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/MathOperation.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public enum MathOperation { ADD, SUBTRACT, DIVIDE, MULTIPLY diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/MathProcessing.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/MathProcessing.java similarity index 85% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/MathProcessing.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/MathProcessing.java index 0d6dde3..37e38db 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/MathProcessing.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/MathProcessing.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public interface MathProcessing { diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Multiplier.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/Multiplier.java similarity index 88% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Multiplier.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/Multiplier.java index c725625..2241bf5 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Multiplier.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/Multiplier.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public class Multiplier extends CalculateBase { diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/NewCalcEngine.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/NewCalcEngine.java similarity index 99% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/NewCalcEngine.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/NewCalcEngine.java index a330217..f54ba8f 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/NewCalcEngine.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/NewCalcEngine.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; import java.util.Scanner; diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/PowerOf.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/PowerOf.java similarity index 93% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/PowerOf.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/PowerOf.java index 8f977a4..ee189b0 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/PowerOf.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/PowerOf.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public class PowerOf implements MathProcessing { diff --git a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Subtractor.java b/Java Classes & Interfaces/src/pluralsite/calculatorengine/Subtractor.java similarity index 88% rename from Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Subtractor.java rename to Java Classes & Interfaces/src/pluralsite/calculatorengine/Subtractor.java index 37b2609..b2a51b9 100644 --- a/Java Classes & Interfaces/Pluralsite/New Calc Engine/src/Subtractor.java +++ b/Java Classes & Interfaces/src/pluralsite/calculatorengine/Subtractor.java @@ -1,4 +1,4 @@ -package src; +package pluralsite.calculatorengine; public class Subtractor extends CalculateBase { diff --git a/Java Fundamentals/Get Organised/src/com/pluralsite/getorganised/GetOrganised.java b/Java Fundamentals/Get Organised/src/com/pluralsite/getorganised/GetOrganised.java deleted file mode 100644 index 79a6774..0000000 --- a/Java Fundamentals/Get Organised/src/com/pluralsite/getorganised/GetOrganised.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.pluralsite.getorganised; - -public class GetOrganised { - public static void main(String[] args) throws Exception { - System.out.println("I'm organised!"); - } -} diff --git a/Java Fundamentals/Calc Engine/src/CalcEngine.java b/Java Fundamentals/src/calculatorengine/CalcEngine.java similarity index 94% rename from Java Fundamentals/Calc Engine/src/CalcEngine.java rename to Java Fundamentals/src/calculatorengine/CalcEngine.java index 22ff746..bd8208a 100644 --- a/Java Fundamentals/Calc Engine/src/CalcEngine.java +++ b/Java Fundamentals/src/calculatorengine/CalcEngine.java @@ -1,3 +1,5 @@ +package calculatorengine; + import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Scanner; @@ -73,7 +75,7 @@ public class CalcEngine { } // Checking to see if value had changed, if not. Parse the string into a double - if (value == -1) + if (value == -1) value = Double.parseDouble(word); return value; @@ -85,7 +87,7 @@ public class CalcEngine { char[] opCodes = {'a', 's', 'm', 'd'}; char[] symbols = {'+', '-', '*', '/'}; char symbol = ' '; - + // Loop through the list of chars and get the relevant symbol for (int i = 0; i < opCodes.length; i++) { if (opCode == opCodes[i]) { @@ -101,7 +103,7 @@ public class CalcEngine { char symbol = symbolFromOpCode(opCode); // StringBuilder stringBuilder = new StringBuilder(); - + // stringBuilder.append(leftVal); // stringBuilder.append(" " + symbol + " "); // stringBuilder.append(rightVal); @@ -110,22 +112,22 @@ public class CalcEngine { // String finalResult = stringBuilder.toString(); - String finalResult = String.format("%.1f %c %.1f = %.1f", - leftVal, symbol, rightVal, result); + String finalResult = String.format("%.1f %c %.1f = %.1f", + leftVal, symbol, rightVal, result); System.out.println(finalResult); } static void handleWhen(String[] stringParts) { /* Return date arithmetic operation (days added) */ - + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("dd-MM-yyyy"); LocalDate startDate = LocalDate.parse(stringParts[1], dateTimeFormatter); long daysToAdd = (long) valueFromWord(stringParts[2]); LocalDate newDate = startDate.plusDays(daysToAdd); - String output = String.format("%s + %d days is %s", - startDate.format(dateTimeFormatter), daysToAdd, newDate.format(dateTimeFormatter)); + String output = String.format("%s + %d days is %s", + startDate.format(dateTimeFormatter), daysToAdd, newDate.format(dateTimeFormatter)); System.out.println(output); } @@ -142,7 +144,7 @@ public class CalcEngine { double rightVal = valueFromWord(stringParts[2]); double result = execute(opCode, leftVal, rightVal); displayResult(opCode, leftVal, rightVal, result); - + } } diff --git a/Java Fundamentals/Hello World/src/HelloWorld.java b/Java Fundamentals/src/helloworld/HelloWorld.java similarity index 85% rename from Java Fundamentals/Hello World/src/HelloWorld.java rename to Java Fundamentals/src/helloworld/HelloWorld.java index 70fd330..1dfeed7 100644 --- a/Java Fundamentals/Hello World/src/HelloWorld.java +++ b/Java Fundamentals/src/helloworld/HelloWorld.java @@ -1,3 +1,5 @@ +package helloworld; + public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); diff --git a/Java Fundamentals/Operator Precedence/src/OperatorPrecedence.java b/Java Fundamentals/src/operatorprecedence/OperatorPrecedence.java similarity index 92% rename from Java Fundamentals/Operator Precedence/src/OperatorPrecedence.java rename to Java Fundamentals/src/operatorprecedence/OperatorPrecedence.java index 6ca8738..370e64a 100644 --- a/Java Fundamentals/Operator Precedence/src/OperatorPrecedence.java +++ b/Java Fundamentals/src/operatorprecedence/OperatorPrecedence.java @@ -1,3 +1,5 @@ +package operatorprecedence; + public class OperatorPrecedence { public static void main(String[] args) { diff --git a/Java Fundamentals/src/organised/com/pluralsite/getorganised/GetOrganised.java b/Java Fundamentals/src/organised/com/pluralsite/getorganised/GetOrganised.java new file mode 100644 index 0000000..8445e06 --- /dev/null +++ b/Java Fundamentals/src/organised/com/pluralsite/getorganised/GetOrganised.java @@ -0,0 +1,7 @@ +package organised.com.pluralsite.getorganised; + +public class GetOrganised { + public static void main(String[] args) { + System.out.println("I'm organised!"); + } +} diff --git a/Java Sets/src/common/Product.java b/Java Sets/src/common/Product.java new file mode 100644 index 0000000..43f2d2e --- /dev/null +++ b/Java Sets/src/common/Product.java @@ -0,0 +1,28 @@ +package common; + +import java.util.Comparator; + +public class Product { + private final String name; + private final int weight; + + public Product(String name, int weight) { + this.name = name; + this.weight = weight; + } + + public String getName() { + return name; + } + + public int getWeight() { + return weight; + } + + @Override + public String toString() { + return "Product{" + "name='" + name + '\'' + ", weight=" + weight + '}'; + } + + public static final Comparator BY_WEIGHT = Comparator.comparingInt(Product::getWeight); +} diff --git a/Java Sets/src/common/Supplier.java b/Java Sets/src/common/Supplier.java new file mode 100644 index 0000000..0738020 --- /dev/null +++ b/Java Sets/src/common/Supplier.java @@ -0,0 +1,26 @@ +package common; + +import java.util.ArrayList; +import java.util.List; + +public class Supplier { + private final String name; + private final List products = new ArrayList<>(); + + public Supplier(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public List getProducts() { + return products; + } + + @Override + public String toString() { + return "Supplier{" + "name='" + name + '\'' + ", products=" + products + '}'; + } +} diff --git a/Personal/Anagram/.idea/.gitignore b/Personal/Anagram/.idea/.gitignore deleted file mode 100644 index 3cd6fe9..0000000 --- a/Personal/Anagram/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/../../../../../../../../:\Users\sgoud\JavaProjects\Learning-Java\Personal\Anagram\.idea/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/Personal/Anagram/.idea/aws.xml b/Personal/Anagram/.idea/aws.xml deleted file mode 100644 index b63b642..0000000 --- a/Personal/Anagram/.idea/aws.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/.idea/discord.xml b/Personal/Anagram/.idea/discord.xml deleted file mode 100644 index cd711a0..0000000 --- a/Personal/Anagram/.idea/discord.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Personal/Anagram/.idea/misc.xml b/Personal/Anagram/.idea/misc.xml deleted file mode 100644 index 40674af..0000000 --- a/Personal/Anagram/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/.idea/modules.xml b/Personal/Anagram/.idea/modules.xml deleted file mode 100644 index 3dbf918..0000000 --- a/Personal/Anagram/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/.idea/vcs.xml b/Personal/Anagram/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/Personal/Anagram/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/Anagram.iml b/Personal/Anagram/Anagram.iml deleted file mode 100644 index b107a2d..0000000 --- a/Personal/Anagram/Anagram.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/out/production/Anagram/.idea/.gitignore b/Personal/Anagram/out/production/Anagram/.idea/.gitignore deleted file mode 100644 index 3cd6fe9..0000000 --- a/Personal/Anagram/out/production/Anagram/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/../../../../../../../../:\Users\sgoud\JavaProjects\Learning-Java\Personal\Anagram\.idea/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/Personal/Anagram/out/production/Anagram/.idea/aws.xml b/Personal/Anagram/out/production/Anagram/.idea/aws.xml deleted file mode 100644 index b63b642..0000000 --- a/Personal/Anagram/out/production/Anagram/.idea/aws.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/out/production/Anagram/.idea/misc.xml b/Personal/Anagram/out/production/Anagram/.idea/misc.xml deleted file mode 100644 index 40674af..0000000 --- a/Personal/Anagram/out/production/Anagram/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/out/production/Anagram/.idea/modules.xml b/Personal/Anagram/out/production/Anagram/.idea/modules.xml deleted file mode 100644 index 3dbf918..0000000 --- a/Personal/Anagram/out/production/Anagram/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/out/production/Anagram/.idea/vcs.xml b/Personal/Anagram/out/production/Anagram/.idea/vcs.xml deleted file mode 100644 index b2bdec2..0000000 --- a/Personal/Anagram/out/production/Anagram/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/out/production/Anagram/Anagram.iml b/Personal/Anagram/out/production/Anagram/Anagram.iml deleted file mode 100644 index b107a2d..0000000 --- a/Personal/Anagram/out/production/Anagram/Anagram.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Personal/Anagram/out/production/Anagram/src/AnagramGenerator.class b/Personal/Anagram/out/production/Anagram/src/AnagramGenerator.class deleted file mode 100644 index c657361424ad106700278c7093301b3ea6b12356..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2775 zcma)8X>-$76g_fG=#EwmRv~=gzhcf z_id)_$9~~!VWxp0GyMVm0sRgA4V||1JjqU+#B@3yOM36!ckemp-gl+n{<-@rfHb~~ zBZ4{|Q3D%LuVK?=F)s!!Vdn?WO<$H-Uqk(2(>DF18tRg%2^}#FErC(VH?6^8*A)vH z)AQrdQ5VNX7&;maJbT&Ys;%7QabU|mQXIE*72V!l&JS8K8wK{%V%aZJPJl^Ph& z3fq=$1BP)z$B2O^aI&IEkhAdx&zA)a5z{8C5SHl-j@reNPoGj02Wofx)7-W7#}GZV*oJgwt`fpJ`{lps-81!4}1Dy*ewRcD|qRBA%e znlLb_WR0qP$1w#~%q0WQ;{^?^o|_#k$2=`5qVOG7b|dp2`cOwpL#meZkoxLVNFAr} zl7W{YG&JQykFp$K#m|~eHFDg{?vOQ*gXFm=h&egp*jeFEn*J=GJYU$pr(y5?afOKw zPJNKvyn$KOU^Zke$D`Beh?C>3DP!95Y^g9U-HT${;!JbK$qH*ixTYGHC!_wX$$0IV zT6(25XeR%oEZveP-ASfd`B{6MX%|ynCe*ZCI%}j*F;>N2C{{4^*Ao12Rg{&sbCjVP z$9<8V8xzGcg@$o6ZwtTVlH>9F>$V!t{oQYLgElj2=j2re^8%&I4NF636|At3%1Z=R z3I6{g)u;_7uOQS>ZckoX7bl&X;JR@0Ojk>dWiEQ`7hJ58v)n-l&X_T6VJ#PIeB3Fy zS$WD-mC?5LpzKo_W~VvfI6egs#WCs6IytYY9v{Z>5kA)OiK^jGHSAd_2GgE*=Hy@~ zOIX&Y_(pMD_Ve$n6H_(}ot~lGmh|>y9A~anOt0r%HM45tMOIJ^^J-}-uc7rWMucUJ zo4!oP@Hr356xFD-sG)>Lxkgpz9kGPxNl(XD8oJjJt%YC5HyXPB+m!EykSunwsYKWi zfGBu^QO~Q%(ID>{?;Cn=L%Yd`2rl!gmch5#9Ir-b01E|1-1}9X4Yp@7-t# z!X@Z3j%~2v1c-Z3#4EIp(aMEKFg`~LR5(-O(|j-!`5SQ^y7niw;tFRXxJn!L(K6hd zWw=92=px)ihFEv~h}06gIqcymxrn|a0rbH|JUrQ}Nbu>=$s6~6?_0#s3WF|+19Z~= zHZ<|$qzgNczy7~aHN9Bri4+jxgiI%usj y6XCrhU{=Sy&3Kn{(d8V4Yo$Q>>)ao~dw8Gs7(INz|7ZAuqd1?w#Mk&1o&N#}=D@rF diff --git a/Personal/Test Driven Development/Hello World/target/classes/hello/world/Greeting.class b/Personal/Test Driven Development/Hello World/target/classes/hello/world/Greeting.class deleted file mode 100644 index 701f0891be8348a0f749ffda6191362f402a3110..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 783 zcmb7>O-~y!5Qbl;X*O&F32A`Raxk32B@q&*w&H?-OMn9(QjgB=C^2}~k=J}&`Bjx# z3GVzT#B3l+B(|zJc;xZSynbfp@#)V!fGw;AC<(NNWQ^_JSZCtyfg|!d9Rw%~G%nP& z>Kc^}y2t$sio8IOP?o6y2{e1t=!th+^FyHWQ>WVR2z+R7o(q(BZA<|^3Dl>_d(K%` z#k|1XS?VaW=9*#|*<_@R^4g|y>61HE%$2up zBW2E&)4BipSoTAm2`u-D#>t}z2jmYY!)vuS-+orb7lHNv&V;418L9BZUb%?&bxt-v z+243NSO;%{S1tH_M1^gc?*Xc8=h)lkXdVmyBK*~?{l>xrdnGKgt&AhwEZ=J{S@?_= pd$~e`?L?u(Z|_xD!t#v5lwqZSVWE&=^&bpH3e7@=ugqP-w`ZYtrpN#Q diff --git a/Personal/Test Driven Development/Hello World/target/classes/hello/world/HelloWorld.class b/Personal/Test Driven Development/Hello World/target/classes/hello/world/HelloWorld.class deleted file mode 100644 index 049906402372a17114a34f0d7b64fedef7b8ac85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 591 zcmah`O-lnY5Phlr*sj&B_4^h*RSzwKCo5h=@lf=jR>V`f8`{+Drli~I)n6qj=-nSB zPFA4`1rM3b3~ydu-h6z%yaCw5W(hflwZ7EaG#`xBQS;2@H!dw9&rltRiD+t(^qLpl zfecfI;-N}Zdc-hS-{~;qk4+>?C^H08?1{C;dYET;x=ySd89k8^4^2E&TBOP(d}vKq z%lLr%<*UBrkqou4gc*wPUi2j2j)h7ZjCnn{wNW(r)X;wZCN!ah% z-xIzM4+|9(u*k4lZ%;*DrdB1rmit7|R*5_x$6aZ!1nFX^wM{5=M_A?RpJqPos}aLS zd$waOa>L0cOY3*D9`dlpu=TGa4F07V+fbe=CncEfBr^nCAoFQ~K#sBkiWEy!?NgW0 z?Z3jit@+QWyl0qzqQihrm15-^g(cLeDq|Td)Nu^Ee;8J0FnAe5F5_CKn8U^wF6WWi diff --git a/Personal/Anagram/src/AnagramGenerator.java b/Personal/src/anagram/AnagramGenerator.java similarity index 98% rename from Personal/Anagram/src/AnagramGenerator.java rename to Personal/src/anagram/AnagramGenerator.java index 1be1c30..d70a571 100644 --- a/Personal/Anagram/src/AnagramGenerator.java +++ b/Personal/src/anagram/AnagramGenerator.java @@ -1,8 +1,8 @@ -package src; +package anagram; -import java.util.Scanner; import java.util.ArrayList; import java.util.Random; +import java.util.Scanner; public class AnagramGenerator { diff --git a/Personal/Cards/src/Card.java b/Personal/src/cards/Card.java similarity index 96% rename from Personal/Cards/src/Card.java rename to Personal/src/cards/Card.java index ec2edd9..e745228 100644 --- a/Personal/Cards/src/Card.java +++ b/Personal/src/cards/Card.java @@ -1,3 +1,5 @@ +package cards; + public class Card { private String suit; diff --git a/Personal/Cards/src/CardMain.java b/Personal/src/cards/CardMain.java similarity index 97% rename from Personal/Cards/src/CardMain.java rename to Personal/src/cards/CardMain.java index c20f166..3ef8f64 100644 --- a/Personal/Cards/src/CardMain.java +++ b/Personal/src/cards/CardMain.java @@ -1,3 +1,5 @@ +package cards; + import java.util.List; import java.util.Scanner; diff --git a/Personal/Cards/src/Deck.java b/Personal/src/cards/Deck.java similarity index 84% rename from Personal/Cards/src/Deck.java rename to Personal/src/cards/Deck.java index 13fa43c..4e9d028 100644 --- a/Personal/Cards/src/Deck.java +++ b/Personal/src/cards/Deck.java @@ -1,9 +1,11 @@ +package cards; + import java.util.ArrayList; import java.util.Collections; import java.util.List; public abstract class Deck { - private List deck = new ArrayList(); + private final List deck = new ArrayList(); public Deck() { for (Suits suit : Suits.values()) { @@ -14,7 +16,7 @@ public abstract class Deck { public List dealCards(int numOfPlayers) { int noOfCards = (deck.size() / numOfPlayers) + 1; - List allPlayers = new ArrayList(); + List allPlayers = new ArrayList<>(); for (int i = 0; i < numOfPlayers; i++) { Hand playerHand = new Hand(); @@ -23,7 +25,7 @@ public abstract class Deck { playerHand.addCard(indexCard); dealACard(indexCard); } - allPlayers.add(new Player("Player " + i, playerHand)); + allPlayers.add(new Player(playerHand)); } return allPlayers; } diff --git a/Personal/Cards/src/Faces.java b/Personal/src/cards/Faces.java similarity index 94% rename from Personal/Cards/src/Faces.java rename to Personal/src/cards/Faces.java index a9787ef..105b45a 100644 --- a/Personal/Cards/src/Faces.java +++ b/Personal/src/cards/Faces.java @@ -1,3 +1,5 @@ +package cards; + public enum Faces { ACE(1), TWO(2), THREE(3), FOUR(4), FIVE(5), SIX(6), SEVEN(7), EIGHT(8), NINE(9), TEN(10), JACK(11), QUEEN(12), KING(13); diff --git a/Personal/Cards/src/Hand.java b/Personal/src/cards/Hand.java similarity index 77% rename from Personal/Cards/src/Hand.java rename to Personal/src/cards/Hand.java index c7476ed..99aa2b6 100644 --- a/Personal/Cards/src/Hand.java +++ b/Personal/src/cards/Hand.java @@ -1,3 +1,5 @@ +package cards; + import java.util.ArrayList; import java.util.List; @@ -9,17 +11,17 @@ public class Hand { @Override public String toString() { - StringBuilder handofSuit = new StringBuilder(); + StringBuilder handOfSuit = new StringBuilder(); - handofSuit.append("["); + handOfSuit.append("["); for (Card card : listOfCards) { - handofSuit.append(card.getFace() + ","); + handOfSuit.append(card.getFace()).append(","); } - if (handofSuit.length() != 1) - handofSuit.deleteCharAt(handofSuit.length() - 1); - handofSuit.append("]"); + if (handOfSuit.length() != 1) + handOfSuit.deleteCharAt(handOfSuit.length() - 1); + handOfSuit.append("]"); - return handofSuit.toString(); + return handOfSuit.toString(); } diff --git a/Personal/Cards/src/Player.java b/Personal/src/cards/Player.java similarity index 81% rename from Personal/Cards/src/Player.java rename to Personal/src/cards/Player.java index ebb767c..48d53e9 100644 --- a/Personal/Cards/src/Player.java +++ b/Personal/src/cards/Player.java @@ -1,7 +1,9 @@ +package cards; + public class Player { private Hand hand; - public Player(String name, Hand hand) { + public Player(Hand hand) { this.hand = hand; } @@ -12,7 +14,7 @@ public class Player { Card card = hand.getListOfCards().get(i); if (i % 2 == 0) { - System.out.printf(tab + card.getFace() + " of " + card.getSuit()); + System.out.print(tab + card.getFace() + " of " + card.getSuit()); } else { System.out.println(tab + card.getFace() + " of " + card.getSuit()); } diff --git a/Personal/Cards/src/Sevens.java b/Personal/src/cards/Sevens.java similarity index 89% rename from Personal/Cards/src/Sevens.java rename to Personal/src/cards/Sevens.java index 63bd13b..e2c8964 100644 --- a/Personal/Cards/src/Sevens.java +++ b/Personal/src/cards/Sevens.java @@ -1,3 +1,5 @@ +package cards; + import java.util.List; import java.util.Scanner; @@ -20,7 +22,7 @@ public class Sevens extends Deck { System.out.println("\nPlayer " + (playerCounter + 1) + "'s Deck:\n"); player.displayHand(); - String[] userCardSplit = askPlayer(playerCounter, player, tableHand, in); + String[] userCardSplit = askPlayer(in); if (userCardSplit.length != 0) { validateCard(userCardSplit, player, tableHand); @@ -34,7 +36,7 @@ public class Sevens extends Deck { tableHand.display("Winning Deck:"); } - public String[] askPlayer(int playerCounter, Player player, TableHand tableHand, Scanner in) { + public String[] askPlayer(Scanner in) { System.out.println("\nEnter In The Card That You Want To Play: \nPress S To Skip"); String userCard = in.nextLine(); if (userCard.toLowerCase().charAt(0) == 's') { @@ -44,13 +46,13 @@ public class Sevens extends Deck { String[] splitCard = userCard.split(" "); if (splitCard.length == 2) - validatePlayerInput(splitCard, player, tableHand, in); + validatePlayerInput(splitCard, in); return splitCard; } - public void validatePlayerInput(String[] splitCard, Player player, TableHand tableHand, Scanner in) { + public void validatePlayerInput(String[] splitCard, Scanner in) { try { Integer.parseInt(splitCard[0]); @@ -71,7 +73,7 @@ public class Sevens extends Deck { break; } } - if (validSuit == false) { + if (!validSuit) { System.out.println("Card Suit Not Valid! Please Enter A Suitable Suit"); splitCard[1] = in.nextLine(); } @@ -102,7 +104,6 @@ public class Sevens extends Deck { playACard(userSuitHand, cardToBePlayed, 0, player); } else { System.out.println("Card Played Was Not A Face of 7 in Empty Suit! Turn Skipped!"); - return; } } else { int minimumValueInUserSuitHand = userSuitHand.getListOfCards().get(0).getFace(); @@ -114,8 +115,7 @@ public class Sevens extends Deck { } else if (cardToBePlayed.getFace() == (maximumValueInUserSuitHand + 1)) { playACard(userSuitHand, cardToBePlayed, sizeOfUserSuitHand, player); } else { - System.out.println("Card Plyaed Was Not +1 or +1 Of Any Cards In The Suit! Turn Skipped!"); - return; + System.out.println("Card Played Was Not +1 or +1 Of Any Cards In The Suit! Turn Skipped!"); } } } diff --git a/Personal/Cards/src/Suits.java b/Personal/src/cards/Suits.java similarity index 93% rename from Personal/Cards/src/Suits.java rename to Personal/src/cards/Suits.java index 0b14d8d..eccf3ae 100644 --- a/Personal/Cards/src/Suits.java +++ b/Personal/src/cards/Suits.java @@ -1,3 +1,5 @@ +package cards; + public enum Suits { SPADES("Spades"), HEARTS("Hearts"), DIAMONDS("Diamonds"), CLUBS("Clubs"); diff --git a/Personal/Cards/src/TableHand.java b/Personal/src/cards/TableHand.java similarity index 88% rename from Personal/Cards/src/TableHand.java rename to Personal/src/cards/TableHand.java index bac07e8..215fbce 100644 --- a/Personal/Cards/src/TableHand.java +++ b/Personal/src/cards/TableHand.java @@ -1,9 +1,11 @@ +package cards; + import java.util.EnumMap; import java.util.Map.Entry; public class TableHand extends Hand { - private EnumMap sevensTableHand = new EnumMap(Suits.class); + private EnumMap sevensTableHand = new EnumMap<>(Suits.class); public TableHand() { for (Suits suit : Suits.values()) { diff --git a/Personal/SimpleOOPExample/src/Coordinates.java b/Personal/src/oop/Coordinates.java similarity index 96% rename from Personal/SimpleOOPExample/src/Coordinates.java rename to Personal/src/oop/Coordinates.java index d7fb997..1f6319e 100644 --- a/Personal/SimpleOOPExample/src/Coordinates.java +++ b/Personal/src/oop/Coordinates.java @@ -1,3 +1,5 @@ +package oop; + public class Coordinates { private int x; private int y; diff --git a/Personal/SimpleOOPExample/src/Equation.java b/Personal/src/oop/Equation.java similarity index 80% rename from Personal/SimpleOOPExample/src/Equation.java rename to Personal/src/oop/Equation.java index 84dbda4..422702b 100644 --- a/Personal/SimpleOOPExample/src/Equation.java +++ b/Personal/src/oop/Equation.java @@ -1,3 +1,5 @@ +package oop; + public interface Equation { void displayEquation(); } diff --git a/Personal/SimpleOOPExample/src/Line.java b/Personal/src/oop/Line.java similarity index 98% rename from Personal/SimpleOOPExample/src/Line.java rename to Personal/src/oop/Line.java index 07920d8..d6ab48e 100644 --- a/Personal/SimpleOOPExample/src/Line.java +++ b/Personal/src/oop/Line.java @@ -1,3 +1,5 @@ +package oop; + public class Line implements Equation { private double gradient; private double intercept; diff --git a/Personal/SimpleOOPExample/src/Main.java b/Personal/src/oop/Main.java similarity index 96% rename from Personal/SimpleOOPExample/src/Main.java rename to Personal/src/oop/Main.java index 440c4b1..767acbd 100644 --- a/Personal/SimpleOOPExample/src/Main.java +++ b/Personal/src/oop/Main.java @@ -1,3 +1,5 @@ +package oop; + public class Main { public static void main(String[] args) { Coordinates coordinate1 = new Coordinates(4, 16); diff --git a/Personal/Test Driven Development/Hello World/.idea/.gitignore b/Personal/src/tdd/helloworld/.idea/.gitignore similarity index 100% rename from Personal/Test Driven Development/Hello World/.idea/.gitignore rename to Personal/src/tdd/helloworld/.idea/.gitignore diff --git a/Personal/Test Driven Development/Hello World/.idea/.name b/Personal/src/tdd/helloworld/.idea/.name similarity index 100% rename from Personal/Test Driven Development/Hello World/.idea/.name rename to Personal/src/tdd/helloworld/.idea/.name diff --git a/Personal/Test Driven Development/Hello World/.idea/compiler.xml b/Personal/src/tdd/helloworld/.idea/compiler.xml similarity index 100% rename from Personal/Test Driven Development/Hello World/.idea/compiler.xml rename to Personal/src/tdd/helloworld/.idea/compiler.xml diff --git a/Personal/Test Driven Development/Hello World/.idea/encodings.xml b/Personal/src/tdd/helloworld/.idea/encodings.xml similarity index 100% rename from Personal/Test Driven Development/Hello World/.idea/encodings.xml rename to Personal/src/tdd/helloworld/.idea/encodings.xml diff --git a/Personal/Test Driven Development/Hello World/.idea/libraries/Maven__junit_junit_4_11.xml b/Personal/src/tdd/helloworld/.idea/libraries/Maven__junit_junit_4_11.xml similarity index 100% rename from Personal/Test Driven Development/Hello World/.idea/libraries/Maven__junit_junit_4_11.xml rename to Personal/src/tdd/helloworld/.idea/libraries/Maven__junit_junit_4_11.xml diff --git a/Personal/Test Driven Development/Hello World/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/Personal/src/tdd/helloworld/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml similarity index 100% rename from Personal/Test Driven Development/Hello World/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml rename to Personal/src/tdd/helloworld/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml diff --git a/Personal/Test Driven Development/Hello World/.idea/misc.xml b/Personal/src/tdd/helloworld/.idea/misc.xml similarity index 100% rename from Personal/Test Driven Development/Hello World/.idea/misc.xml rename to Personal/src/tdd/helloworld/.idea/misc.xml diff --git a/Personal/Test Driven Development/Hello World/.idea/modules.xml b/Personal/src/tdd/helloworld/.idea/modules.xml similarity index 100% rename from Personal/Test Driven Development/Hello World/.idea/modules.xml rename to Personal/src/tdd/helloworld/.idea/modules.xml diff --git a/Personal/Test Driven Development/Hello World/.idea/vcs.xml b/Personal/src/tdd/helloworld/.idea/vcs.xml similarity index 100% rename from Personal/Test Driven Development/Hello World/.idea/vcs.xml rename to Personal/src/tdd/helloworld/.idea/vcs.xml diff --git a/Personal/Test Driven Development/Hello World/lib/hamcrest-core-1.3.jar b/Personal/src/tdd/helloworld/lib/hamcrest-core-1.3.jar similarity index 100% rename from Personal/Test Driven Development/Hello World/lib/hamcrest-core-1.3.jar rename to Personal/src/tdd/helloworld/lib/hamcrest-core-1.3.jar diff --git a/Personal/Test Driven Development/Hello World/lib/junit-4.12.jar b/Personal/src/tdd/helloworld/lib/junit-4.12.jar similarity index 100% rename from Personal/Test Driven Development/Hello World/lib/junit-4.12.jar rename to Personal/src/tdd/helloworld/lib/junit-4.12.jar diff --git a/Personal/Test Driven Development/Hello World/src/main/java/hello/world/Greeting.java b/Personal/src/tdd/helloworld/src/main/java/hello/world/Greeting.java similarity index 85% rename from Personal/Test Driven Development/Hello World/src/main/java/hello/world/Greeting.java rename to Personal/src/tdd/helloworld/src/main/java/hello/world/Greeting.java index 05e23a4..7558635 100644 --- a/Personal/Test Driven Development/Hello World/src/main/java/hello/world/Greeting.java +++ b/Personal/src/tdd/helloworld/src/main/java/hello/world/Greeting.java @@ -1,4 +1,4 @@ -package main.java.hello.world; +package tdd.helloworld.src.main.java.hello.world; public class Greeting { String message; diff --git a/Personal/Test Driven Development/Hello World/src/main/java/hello/world/HelloWorld.java b/Personal/src/tdd/helloworld/src/main/java/hello/world/HelloWorld.java similarity index 81% rename from Personal/Test Driven Development/Hello World/src/main/java/hello/world/HelloWorld.java rename to Personal/src/tdd/helloworld/src/main/java/hello/world/HelloWorld.java index f9cd300..a5449df 100644 --- a/Personal/Test Driven Development/Hello World/src/main/java/hello/world/HelloWorld.java +++ b/Personal/src/tdd/helloworld/src/main/java/hello/world/HelloWorld.java @@ -1,4 +1,4 @@ -package main.java.hello.world; +package tdd.helloworld.src.main.java.hello.world; /** * Hello world! diff --git a/Personal/Test Driven Development/Hello World/src/test/java/hello/world/HelloWorldTest.java b/Personal/src/tdd/helloworld/src/test/java/hello/world/HelloWorldTest.java similarity index 68% rename from Personal/Test Driven Development/Hello World/src/test/java/hello/world/HelloWorldTest.java rename to Personal/src/tdd/helloworld/src/test/java/hello/world/HelloWorldTest.java index c72fe29..3b33f1c 100644 --- a/Personal/Test Driven Development/Hello World/src/test/java/hello/world/HelloWorldTest.java +++ b/Personal/src/tdd/helloworld/src/test/java/hello/world/HelloWorldTest.java @@ -1,9 +1,10 @@ -package test.java.hello.world; +package tdd.helloworld.src.test.java.hello.world; -import main.java.hello.world.Greeting; import org.junit.Test; +import tdd.helloworld.src.main.java.hello.world.Greeting; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; /** * Unit test for simple App. @@ -21,6 +22,6 @@ public class HelloWorldTest { @Test public void greetingMessageShouldFail() { Greeting greeting = new Greeting("Not Hello World"); - assertEquals("Hello World", greeting.getMessage()); + assertNotEquals("Hello World", greeting.getMessage()); } }