Complete Refactor of File Directories
parent
9ac119d054
commit
63e3f09a48
@ -1,3 +1,5 @@
|
|||||||
|
package arrays;
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class SimpleArrays {
|
public class SimpleArrays {
|
@ -1,3 +1,5 @@
|
|||||||
|
package conditionals;
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class ConditionalStatements {
|
public class ConditionalStatements {
|
@ -1,3 +1,5 @@
|
|||||||
|
package scanner;
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class UsingScanner {
|
public class UsingScanner {
|
@ -1,3 +1,5 @@
|
|||||||
|
package strings;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
@ -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();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -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!");
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.animals;
|
||||||
|
|
||||||
public interface Animal {
|
public interface Animal {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.animals;
|
||||||
|
|
||||||
public class AnimalHelper {
|
public class AnimalHelper {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.animals;
|
||||||
|
|
||||||
public class AnimalMain {
|
public class AnimalMain {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.animals;
|
||||||
|
|
||||||
public class Cat implements Animal {
|
public class Cat implements Animal {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.animals;
|
||||||
|
|
||||||
public class Cow implements Animal {
|
public class Cow implements Animal {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.animals;
|
||||||
|
|
||||||
public class Dog implements Animal {
|
public class Dog implements Animal {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.animals;
|
||||||
|
|
||||||
public class Horse implements Animal {
|
public class Horse implements Animal {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.counter;
|
||||||
|
|
||||||
public class ByFives implements Counter {
|
public class ByFives implements Counter {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.counter;
|
||||||
|
|
||||||
public class ByFours implements Counter {
|
public class ByFours implements Counter {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.counter;
|
||||||
|
|
||||||
public class ByOnes implements Counter {
|
public class ByOnes implements Counter {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.counter;
|
||||||
|
|
||||||
public class ByThrees implements Counter {
|
public class ByThrees implements Counter {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.counter;
|
||||||
|
|
||||||
public class ByTwos implements Counter {
|
public class ByTwos implements Counter {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.counter;
|
||||||
|
|
||||||
public interface Counter {
|
public interface Counter {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.counter;
|
||||||
|
|
||||||
public class CounterHelper {
|
public class CounterHelper {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package interfaces.counter;
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public class Adder extends CalculateBase implements MathProcessing {
|
public class Adder extends CalculateBase implements MathProcessing {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public abstract class CalculateBase {
|
public abstract class CalculateBase {
|
||||||
private double leftVal;
|
private double leftVal;
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public class Divider extends CalculateBase {
|
public class Divider extends CalculateBase {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public class DynamicHelper {
|
public class DynamicHelper {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public class MathEquation {
|
public class MathEquation {
|
||||||
private double leftVal;
|
private double leftVal;
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public enum MathOperation {
|
public enum MathOperation {
|
||||||
ADD, SUBTRACT, DIVIDE, MULTIPLY
|
ADD, SUBTRACT, DIVIDE, MULTIPLY
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public interface MathProcessing {
|
public interface MathProcessing {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public class Multiplier extends CalculateBase {
|
public class Multiplier extends CalculateBase {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public class PowerOf implements MathProcessing {
|
public class PowerOf implements MathProcessing {
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package src;
|
package pluralsite.calculatorengine;
|
||||||
|
|
||||||
public class Subtractor extends CalculateBase {
|
public class Subtractor extends CalculateBase {
|
||||||
|
|
@ -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!");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +1,5 @@
|
|||||||
|
package helloworld;
|
||||||
|
|
||||||
public class HelloWorld {
|
public class HelloWorld {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println("Hello, World!");
|
System.out.println("Hello, World!");
|
@ -1,3 +1,5 @@
|
|||||||
|
package operatorprecedence;
|
||||||
|
|
||||||
public class OperatorPrecedence {
|
public class OperatorPrecedence {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
package organised.com.pluralsite.getorganised;
|
||||||
|
|
||||||
|
public class GetOrganised {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("I'm organised!");
|
||||||
|
}
|
||||||
|
}
|
@ -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<Product> BY_WEIGHT = Comparator.comparingInt(Product::getWeight);
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package common;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Supplier {
|
||||||
|
private final String name;
|
||||||
|
private final List<Product> products = new ArrayList<>();
|
||||||
|
|
||||||
|
public Supplier(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Product> getProducts() {
|
||||||
|
return products;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Supplier{" + "name='" + name + '\'' + ", products=" + products + '}';
|
||||||
|
}
|
||||||
|
}
|
@ -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/
|
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="accountSettings">
|
|
||||||
<option name="activeRegion" value="us-east-1" />
|
|
||||||
<option name="recentlyUsedRegions">
|
|
||||||
<list>
|
|
||||||
<option value="us-east-1" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="DiscordProjectSettings">
|
|
||||||
<option name="show" value="PROJECT_FILES" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_15" project-jdk-name="15" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/Anagram.iml" filepath="$PROJECT_DIR$/Anagram.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -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/
|
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="accountSettings">
|
|
||||||
<option name="activeRegion" value="us-east-1" />
|
|
||||||
<option name="recentlyUsedRegions">
|
|
||||||
<list>
|
|
||||||
<option value="us-east-1" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_15" project-jdk-name="15" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/Anagram.iml" filepath="$PROJECT_DIR$/Anagram.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,8 +1,8 @@
|
|||||||
package src;
|
package anagram;
|
||||||
|
|
||||||
import java.util.Scanner;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class AnagramGenerator {
|
public class AnagramGenerator {
|
||||||
|
|
@ -1,3 +1,5 @@
|
|||||||
|
package cards;
|
||||||
|
|
||||||
public class Card {
|
public class Card {
|
||||||
|
|
||||||
private String suit;
|
private String suit;
|
@ -1,3 +1,5 @@
|
|||||||
|
package cards;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
@ -1,3 +1,5 @@
|
|||||||
|
package cards;
|
||||||
|
|
||||||
public enum Faces {
|
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),
|
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);
|
KING(13);
|
@ -1,3 +1,5 @@
|
|||||||
|
package cards;
|
||||||
|
|
||||||
public enum Suits {
|
public enum Suits {
|
||||||
SPADES("Spades"), HEARTS("Hearts"), DIAMONDS("Diamonds"), CLUBS("Clubs");
|
SPADES("Spades"), HEARTS("Hearts"), DIAMONDS("Diamonds"), CLUBS("Clubs");
|
||||||
|
|
@ -1,9 +1,11 @@
|
|||||||
|
package cards;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
public class TableHand extends Hand {
|
public class TableHand extends Hand {
|
||||||
|
|
||||||
private EnumMap<Suits, Hand> sevensTableHand = new EnumMap<Suits, Hand>(Suits.class);
|
private EnumMap<Suits, Hand> sevensTableHand = new EnumMap<>(Suits.class);
|
||||||
|
|
||||||
public TableHand() {
|
public TableHand() {
|
||||||
for (Suits suit : Suits.values()) {
|
for (Suits suit : Suits.values()) {
|
@ -1,3 +1,5 @@
|
|||||||
|
package oop;
|
||||||
|
|
||||||
public class Coordinates {
|
public class Coordinates {
|
||||||
private int x;
|
private int x;
|
||||||
private int y;
|
private int y;
|
@ -1,3 +1,5 @@
|
|||||||
|
package oop;
|
||||||
|
|
||||||
public interface Equation {
|
public interface Equation {
|
||||||
void displayEquation();
|
void displayEquation();
|
||||||
}
|
}
|
@ -1,3 +1,5 @@
|
|||||||
|
package oop;
|
||||||
|
|
||||||
public class Line implements Equation {
|
public class Line implements Equation {
|
||||||
private double gradient;
|
private double gradient;
|
||||||
private double intercept;
|
private double intercept;
|
@ -1,3 +1,5 @@
|
|||||||
|
package oop;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Coordinates coordinate1 = new Coordinates(4, 16);
|
Coordinates coordinate1 = new Coordinates(4, 16);
|
@ -1,4 +1,4 @@
|
|||||||
package main.java.hello.world;
|
package tdd.helloworld.src.main.java.hello.world;
|
||||||
|
|
||||||
public class Greeting {
|
public class Greeting {
|
||||||
String message;
|
String message;
|
@ -1,4 +1,4 @@
|
|||||||
package main.java.hello.world;
|
package tdd.helloworld.src.main.java.hello.world;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hello world!
|
* Hello world!
|
Loading…
Reference in New Issue