├── .idea ├── description.html ├── encodings.xml ├── vcs.xml ├── modules.xml ├── compiler.xml ├── misc.xml ├── uiDesigner.xml └── workspace.xml ├── out └── production │ └── Class │ ├── arlist │ ├── Main.class │ ├── ALToA.class │ └── SortComparator.class │ ├── simple │ └── textgui │ │ └── Main.class │ ├── DesignPatterns │ ├── Factory │ │ ├── Bike.class │ │ ├── DirtBike.class │ │ ├── SportsBike.class │ │ ├── BikeFactory.class │ │ ├── BikeShowRoom.class │ │ ├── SkyFlyingBike.class │ │ └── WaterDrowingBike.class │ ├── Singleton │ │ ├── Main.class │ │ └── Steering.class │ ├── StrategyPattern │ │ ├── Vk.class │ │ ├── Main.class │ │ ├── Student.class │ │ ├── Wechat.class │ │ ├── Facebook.class │ │ ├── ChineseStudent.class │ │ ├── IndianStudent.class │ │ ├── RussianStudent.class │ │ └── SocialNetwork.class │ └── Decorator │ │ └── Pattern │ │ ├── CarService │ │ ├── Main.class │ │ ├── EngineFix.class │ │ ├── OilChange.class │ │ ├── CarService.class │ │ ├── TireRotation.class │ │ └── BasicCarService.class │ │ └── CarExtensions │ │ ├── Main.class │ │ ├── BasicCar.class │ │ ├── CushionSeat.class │ │ ├── MusicSystem.class │ │ ├── RearCamera.class │ │ └── CarExtension.class │ └── school │ └── management │ └── system │ ├── Main.class │ ├── School.class │ ├── Student.class │ └── Teacher.class ├── src ├── DesignPatterns │ ├── StrategyPattern │ │ ├── SocialNetwork.java │ │ ├── Vk.java │ │ ├── Wechat.java │ │ ├── Facebook.java │ │ ├── RussianStudent.java │ │ ├── ChineseStudent.java │ │ ├── IndianStudent.java │ │ ├── Student.java │ │ └── Main.java │ ├── Factory │ │ ├── Bike.java │ │ ├── DirtBike.java │ │ ├── SportsBike.java │ │ ├── SkyFlyingBike.java │ │ ├── WaterDrowingBike.java │ │ ├── BikeShowRoom.java │ │ └── BikeFactory.java │ ├── Decorator │ │ └── Pattern │ │ │ ├── CarExtensions │ │ │ ├── CarExtension.java │ │ │ ├── BasicCar.java │ │ │ ├── Main.java │ │ │ ├── CushionSeat.java │ │ │ ├── MusicSystem.java │ │ │ └── RearCamera.java │ │ │ └── CarService │ │ │ ├── CarService.java │ │ │ ├── BasicCarService.java │ │ │ ├── Main.java │ │ │ ├── EngineFix.java │ │ │ ├── OilChange.java │ │ │ └── TireRotation.java │ └── Singleton │ │ ├── Main.java │ │ └── Steering.java ├── arlist │ ├── SortComparator.java │ ├── ALToA.java │ └── Main.java ├── school │ └── management │ │ └── system │ │ ├── Teacher.java │ │ ├── Main.java │ │ ├── School.java │ │ └── Student.java └── simple │ └── textgui │ └── Main.java └── Class.iml /.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple Java application that includes a class with main() method -------------------------------------------------------------------------------- /out/production/Class/arlist/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/arlist/Main.class -------------------------------------------------------------------------------- /out/production/Class/arlist/ALToA.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/arlist/ALToA.class -------------------------------------------------------------------------------- /out/production/Class/arlist/SortComparator.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/arlist/SortComparator.class -------------------------------------------------------------------------------- /out/production/Class/simple/textgui/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/simple/textgui/Main.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Factory/Bike.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Factory/Bike.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Factory/DirtBike.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Factory/DirtBike.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Singleton/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Singleton/Main.class -------------------------------------------------------------------------------- /out/production/Class/school/management/system/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/school/management/system/Main.class -------------------------------------------------------------------------------- /out/production/Class/school/management/system/School.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/school/management/system/School.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Factory/SportsBike.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Factory/SportsBike.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Singleton/Steering.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Singleton/Steering.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/StrategyPattern/Vk.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/StrategyPattern/Vk.class -------------------------------------------------------------------------------- /out/production/Class/school/management/system/Student.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/school/management/system/Student.class -------------------------------------------------------------------------------- /out/production/Class/school/management/system/Teacher.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/school/management/system/Teacher.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Factory/BikeFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Factory/BikeFactory.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Factory/BikeShowRoom.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Factory/BikeShowRoom.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Factory/SkyFlyingBike.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Factory/SkyFlyingBike.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/StrategyPattern/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/StrategyPattern/Main.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/StrategyPattern/Student.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/StrategyPattern/Student.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/StrategyPattern/Wechat.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/StrategyPattern/Wechat.class -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Factory/WaterDrowingBike.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Factory/WaterDrowingBike.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/StrategyPattern/Facebook.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/StrategyPattern/Facebook.class -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/StrategyPattern/ChineseStudent.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/StrategyPattern/ChineseStudent.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/StrategyPattern/IndianStudent.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/StrategyPattern/IndianStudent.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/StrategyPattern/RussianStudent.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/StrategyPattern/RussianStudent.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/StrategyPattern/SocialNetwork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/StrategyPattern/SocialNetwork.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarService/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarService/Main.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/Main.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarService/EngineFix.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarService/EngineFix.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarService/OilChange.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarService/OilChange.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/BasicCar.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/BasicCar.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarService/CarService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarService/CarService.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarService/TireRotation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarService/TireRotation.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/CushionSeat.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/CushionSeat.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/MusicSystem.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/MusicSystem.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/RearCamera.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/RearCamera.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/CarExtension.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarExtensions/CarExtension.class -------------------------------------------------------------------------------- /out/production/Class/DesignPatterns/Decorator/Pattern/CarService/BasicCarService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithvasudev/Java-Basic-Tutorials/HEAD/out/production/Class/DesignPatterns/Decorator/Pattern/CarService/BasicCarService.class -------------------------------------------------------------------------------- /src/DesignPatterns/StrategyPattern/SocialNetwork.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.StrategyPattern; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public interface SocialNetwork { 7 | 8 | void useIt(); 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/DesignPatterns/Factory/Bike.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Factory; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public abstract class Bike { 7 | 8 | public abstract String getDescription(); 9 | public abstract int getCost(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarExtensions/CarExtension.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarExtensions; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public interface CarExtension { 7 | String getDescription(); 8 | int getCost(); 9 | } 10 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarService/CarService.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarService; 2 | 3 | /** 4 | * Created by Rakshith on 4/19/2017. 5 | */ 6 | public interface CarService { 7 | public String getDescription(); 8 | public int getCost(); 9 | } 10 | -------------------------------------------------------------------------------- /src/DesignPatterns/StrategyPattern/Vk.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.StrategyPattern; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public class Vk implements SocialNetwork { 7 | @Override 8 | public void useIt() { 9 | System.out.println("Using Vk"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/DesignPatterns/StrategyPattern/Wechat.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.StrategyPattern; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public class Wechat implements SocialNetwork { 7 | @Override 8 | public void useIt() { 9 | System.out.println("Using WeChat"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/DesignPatterns/StrategyPattern/Facebook.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.StrategyPattern; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public class Facebook implements SocialNetwork { 7 | @Override 8 | public void useIt() { 9 | System.out.println("Using Facebook"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/arlist/SortComparator.java: -------------------------------------------------------------------------------- 1 | package arlist; 2 | 3 | import java.util.Comparator; 4 | 5 | /** 6 | * Created by Rakshith on 4/14/2017. 7 | */ 8 | public class SortComparator implements Comparator { 9 | @Override 10 | public int compare(Integer o1, Integer o2) { 11 | return o2.compareTo(o1); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DesignPatterns/Factory/DirtBike.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Factory; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class DirtBike extends Bike { 7 | 8 | @Override 9 | public String getDescription() { 10 | return "DirtBike"; 11 | } 12 | 13 | @Override 14 | public int getCost() { 15 | return 1000; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DesignPatterns/Factory/SportsBike.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Factory; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class SportsBike extends Bike { 7 | @Override 8 | public String getDescription() { 9 | return "SportsBike"; 10 | } 11 | 12 | @Override 13 | public int getCost() { 14 | return 660; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DesignPatterns/Factory/SkyFlyingBike.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Factory; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class SkyFlyingBike extends Bike { 7 | @Override 8 | public String getDescription() { 9 | return "Sky Flying Bike"; 10 | } 11 | 12 | @Override 13 | public int getCost() { 14 | return 5000; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DesignPatterns/Factory/WaterDrowingBike.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Factory; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class WaterDrowingBike extends Bike { 7 | @Override 8 | public String getDescription() { 9 | return "Water Drowing Bike"; 10 | } 11 | 12 | @Override 13 | public int getCost() { 14 | return 10; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarExtensions/BasicCar.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarExtensions; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class BasicCar implements CarExtension { 7 | 8 | @Override 9 | public String getDescription() { 10 | return "Basic Car"; 11 | } 12 | 13 | @Override 14 | public int getCost() { 15 | return 100000; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DesignPatterns/StrategyPattern/RussianStudent.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.StrategyPattern; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public class RussianStudent extends Student { 7 | public RussianStudent(String name) { 8 | super(name); 9 | socialNetwork = new Vk(); 10 | } 11 | 12 | @Override 13 | public void useSocialNetwork() { 14 | socialNetwork.useIt(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DesignPatterns/StrategyPattern/ChineseStudent.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.StrategyPattern; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public class ChineseStudent extends Student { 7 | public ChineseStudent(String name) { 8 | super(name); 9 | socialNetwork = new Wechat(); 10 | } 11 | 12 | @Override 13 | public void useSocialNetwork() { 14 | socialNetwork.useIt(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DesignPatterns/StrategyPattern/IndianStudent.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.StrategyPattern; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public class IndianStudent extends Student { 7 | 8 | public IndianStudent(String name) { 9 | super(name); 10 | socialNetwork = new Facebook(); 11 | } 12 | 13 | @Override 14 | public void useSocialNetwork() { 15 | socialNetwork.useIt(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarService/BasicCarService.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarService; 2 | 3 | /** 4 | * Created by Rakshith on 4/19/2017. 5 | */ 6 | public class BasicCarService implements CarService { 7 | 8 | @Override 9 | public String getDescription() { 10 | return "Basic Car Service"; 11 | } 12 | 13 | @Override 14 | public int getCost() { 15 | return 10; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Class.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/DesignPatterns/Factory/BikeShowRoom.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Factory; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class BikeShowRoom { 7 | public static void main(String[] args) { 8 | String bikeName = "SportsBike"; 9 | Bike bike = BikeFactory.createBike(bikeName); 10 | System.out.println("Bike is: "+ bike.getDescription()); 11 | System.out.println("Bike cost is :"+ bike.getCost()); 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarService/Main.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarService; 2 | 3 | /** 4 | * Created by Rakshith on 4/19/2017. 5 | */ 6 | public class Main { 7 | 8 | public static void main(String[] args) { 9 | CarService carService = new EngineFix(new OilChange(new OilChange(new TireRotation(new BasicCarService())))); 10 | System.out.println(carService.getDescription()); 11 | System.out.println(carService.getCost()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarExtensions/Main.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarExtensions; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class Main { 7 | public static void main(String[] args) { 8 | 9 | CarExtension extension = new RearCamera(new CushionSeat 10 | (new CushionSeat(new MusicSystem(new BasicCar())))); 11 | System.out.println(extension.getDescription()); 12 | System.out.println(extension.getCost()); 13 | 14 | 15 | } 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/DesignPatterns/StrategyPattern/Student.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.StrategyPattern; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public abstract class Student{ 7 | protected String Name; 8 | protected SocialNetwork socialNetwork; //Composition 9 | 10 | public Student(String name) { 11 | Name = name; 12 | } 13 | 14 | public abstract void useSocialNetwork(); 15 | 16 | public void setSocialNetwork(SocialNetwork socialNetwork){ 17 | this.socialNetwork = socialNetwork; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/DesignPatterns/Singleton/Main.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Singleton; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public class Main { 7 | public static void main(String[] args) { 8 | Steering steering1 = Steering.getUniqueInstance(); 9 | Steering steering2 = Steering.getUniqueInstance(); 10 | Steering steering3 = Steering.getUniqueInstance(); 11 | 12 | 13 | System.out.println(steering1); 14 | System.out.println(steering2); 15 | System.out.println(steering3); 16 | 17 | 18 | 19 | 20 | 21 | 22 | } 23 | 24 | 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarService/EngineFix.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarService; 2 | 3 | /** 4 | * Created by Rakshith on 4/19/2017. 5 | */ 6 | public class EngineFix implements CarService { 7 | CarService carService; 8 | 9 | public EngineFix(CarService carService) { 10 | this.carService = carService; 11 | } 12 | 13 | @Override 14 | public String getDescription() { 15 | return carService.getDescription() + ", EngineFix"; 16 | } 17 | 18 | @Override 19 | public int getCost() { 20 | return carService.getCost() +50; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarService/OilChange.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarService; 2 | 3 | /** 4 | * Created by Rakshith on 4/19/2017. 5 | */ 6 | public class OilChange implements CarService { 7 | CarService carService; 8 | 9 | public OilChange(CarService carService) { 10 | this.carService = carService; 11 | } 12 | 13 | @Override 14 | public String getDescription() { 15 | return carService.getDescription() + ", OilChange"; 16 | } 17 | 18 | @Override 19 | public int getCost() { 20 | return carService.getCost() + 10; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarService/TireRotation.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarService; 2 | 3 | /** 4 | * Created by Rakshith on 4/19/2017. 5 | */ 6 | public class TireRotation implements CarService { 7 | CarService carService; 8 | public TireRotation(CarService carService) { 9 | this.carService = carService; 10 | } 11 | 12 | @Override 13 | public String getDescription() { 14 | return carService.getDescription()+ ", Tire Rotation"; 15 | } 16 | 17 | @Override 18 | public int getCost() { 19 | return carService.getCost() + 20; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarExtensions/CushionSeat.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarExtensions; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class CushionSeat implements CarExtension { 7 | CarExtension carExtension; 8 | 9 | public CushionSeat(CarExtension carExtension) { 10 | this.carExtension = carExtension; 11 | } 12 | 13 | @Override 14 | public String getDescription() { 15 | return carExtension.getDescription()+ ", CushionSeat"; 16 | } 17 | 18 | @Override 19 | public int getCost() { 20 | return carExtension.getCost()+ 50; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarExtensions/MusicSystem.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarExtensions; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class MusicSystem implements CarExtension { 7 | CarExtension carExtension; 8 | 9 | public MusicSystem(CarExtension carExtension) { 10 | this.carExtension = carExtension; 11 | } 12 | 13 | @Override 14 | public String getDescription() { 15 | return carExtension.getDescription()+ ", MusicSystem"; 16 | } 17 | 18 | @Override 19 | public int getCost() { 20 | return carExtension.getCost() + 50; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DesignPatterns/Decorator/Pattern/CarExtensions/RearCamera.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Decorator.Pattern.CarExtensions; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class RearCamera implements CarExtension { 7 | CarExtension carExtension; 8 | 9 | public RearCamera(CarExtension carExtension) { 10 | this.carExtension = carExtension; 11 | } 12 | 13 | @Override 14 | public String getDescription() { 15 | return carExtension.getDescription()+ ", RearCamera"; 16 | } 17 | 18 | @Override 19 | public int getCost() { 20 | return carExtension.getCost() + 70; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/DesignPatterns/Singleton/Steering.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Singleton; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public class Steering { 7 | private String size; 8 | private volatile static Steering uniqueInstance = new Steering(); 9 | 10 | private Steering() { 11 | size = "Big"; 12 | } 13 | 14 | public static Steering getUniqueInstance() { 15 | if (uniqueInstance == null) { 16 | synchronized (Steering.class) { 17 | if (uniqueInstance == null) { 18 | uniqueInstance = new Steering(); 19 | } 20 | } 21 | 22 | } 23 | return uniqueInstance; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/DesignPatterns/Factory/BikeFactory.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.Factory; 2 | 3 | /** 4 | * Created by Rakshith on 4/21/2017. 5 | */ 6 | public class BikeFactory { 7 | public static Bike createBike(String bikeName){ 8 | Bike bike=null; 9 | if(bikeName.equalsIgnoreCase("DirtyBike")) 10 | bike = new DirtBike(); 11 | else if(bikeName.equalsIgnoreCase("SkyFlyingBike")) 12 | bike = new SkyFlyingBike(); 13 | else if(bikeName.equalsIgnoreCase("SportsBike")) 14 | bike = new SportsBike(); 15 | else if(bikeName.equalsIgnoreCase("WaterDrowingBike")) 16 | bike = new WaterDrowingBike(); 17 | 18 | return bike; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/arlist/ALToA.java: -------------------------------------------------------------------------------- 1 | package arlist; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | 6 | import java.util.Collections; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Rakshith on 4/14/2017. 11 | */ 12 | public class ALToA{ 13 | 14 | public static void main(String[] args) { 15 | List stringList = new ArrayList<>(); 16 | 17 | stringList.add(5); 18 | stringList.add(10); 19 | stringList.add(3); 20 | stringList.add(22); 21 | stringList.add(76); 22 | 23 | 24 | System.out.println("Before sort: "+ stringList); 25 | Collections.sort(stringList, new SortComparator()); 26 | System.out.println("After sort: "+ stringList); 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/DesignPatterns/StrategyPattern/Main.java: -------------------------------------------------------------------------------- 1 | package DesignPatterns.StrategyPattern; 2 | 3 | /** 4 | * Created by Rakshith on 4/18/2017. 5 | */ 6 | public class Main { 7 | public static void main(String[] args) { 8 | 9 | Student rakshith = new IndianStudent("Rakshith"); 10 | System.out.println("Rakshith uses :"); 11 | rakshith.useSocialNetwork(); 12 | 13 | Student vadim = new RussianStudent("Vadim"); 14 | System.out.println("Vadim uses :"); 15 | vadim.useSocialNetwork(); 16 | 17 | Student zhang = new ChineseStudent("Zhang"); 18 | System.out.println("Zhang uses :"); 19 | zhang.useSocialNetwork(); 20 | 21 | 22 | zhang.setSocialNetwork(new Facebook()); 23 | System.out.println("Zhang Changed to :"); 24 | zhang.useSocialNetwork(); 25 | 26 | 27 | 28 | 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/arlist/Main.java: -------------------------------------------------------------------------------- 1 | package arlist; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * Created by Rakshith on 4/13/2017. 8 | */ 9 | public class Main { 10 | public static void main(String[] args) { 11 | 12 | List integerList = new ArrayList<>(); 13 | integerList.add(5); 14 | integerList.add(35); 15 | integerList.add(75); 16 | integerList.add(105); 17 | 18 | // for (int currentInt:integerList) { 19 | // System.out.println("first: "+currentInt); 20 | // } 21 | // 22 | // for (int i=0;i teacherList = new ArrayList<>(); 16 | teacherList.add(lizzy); 17 | teacherList.add(mellisa); 18 | teacherList.add(vanderhorn); 19 | 20 | 21 | Student tamasha = new Student(1,"Tamasha",4); 22 | Student rakshith = new Student(2,"Rakshith Vasudev",12); 23 | Student rabbi = new Student(3,"Rabbi",5); 24 | List studentList = new ArrayList<>(); 25 | 26 | studentList.add(tamasha); 27 | studentList.add(rabbi); 28 | studentList.add(rakshith); 29 | 30 | 31 | 32 | 33 | School ghs = new School(teacherList,studentList); 34 | 35 | Teacher megan = new Teacher(6,"Megan", 900); 36 | 37 | ghs.addTeacher(megan); 38 | 39 | 40 | tamasha.payFees(5000); 41 | rakshith.payFees(6000); 42 | System.out.println("GHS has earned $"+ ghs.getTotalMoneyEarned()); 43 | 44 | System.out.println("------Making SCHOOL PAY SALARY----"); 45 | lizzy.receiveSalary(lizzy.getSalary()); 46 | System.out.println("GHS has spent for salary to " + lizzy.getName() 47 | +" and now has $" + ghs.getTotalMoneyEarned()); 48 | 49 | vanderhorn.receiveSalary(vanderhorn.getSalary()); 50 | System.out.println("GHS has spent for salary to " + vanderhorn.getName() 51 | +" and now has $" + ghs.getTotalMoneyEarned()); 52 | 53 | 54 | System.out.println(rakshith); 55 | 56 | mellisa.receiveSalary(mellisa.getSalary()); 57 | 58 | System.out.println(mellisa); 59 | 60 | 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/simple/textgui/Main.java: -------------------------------------------------------------------------------- 1 | package simple.textgui; 2 | 3 | 4 | // follow up for https://www.youtube.com/watch?v=e0X00EoFQbE 5 | 6 | import java.util.Scanner; 7 | 8 | public class Main { 9 | 10 | 11 | public static void main(String[] args) { 12 | Scanner in = new Scanner(System.in); 13 | int option; 14 | int number1, number2; 15 | 16 | while(true){ 17 | 18 | System.out.println("Enter your choice. 1: Addition 2. Subtraction 3.Division 4.Multiplication 5. Exit : \n"); 19 | option =Integer.parseInt(in.next()); 20 | 21 | if(option==1){ 22 | askForNumbers(); 23 | number1 = Integer.parseInt(in.next()); 24 | number2 = Integer.parseInt(in.next()); 25 | float sum = number1 + number2; 26 | System.out.println("The sum is :" + sum); 27 | } 28 | else if(option == 2){ 29 | askForNumbers(); 30 | number1 = Integer.parseInt(in.next()); 31 | number2 = Integer.parseInt(in.next()); 32 | float diff = number1 - number2; 33 | System.out.println("The difference is :" + diff); 34 | } 35 | else if(option == 3){ 36 | askForNumbers(); 37 | number1 = Integer.parseInt(in.next()); 38 | number2 = Integer.parseInt(in.next()); 39 | float quotient = number1/number2; 40 | System.out.println("The quotient is :" + quotient); 41 | } 42 | else if(option == 4){ 43 | askForNumbers(); 44 | number1 = Integer.parseInt(in.next()); 45 | number2 = Integer.parseInt(in.next()); 46 | float quotient = number1*number2; 47 | System.out.println("The product is :" + quotient); 48 | }else{ 49 | break; 50 | } 51 | 52 | 53 | } 54 | 55 | 56 | } 57 | 58 | public static void askForNumbers(){ 59 | System.out.println("Enter 2 numbers:"); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/school/management/system/School.java: -------------------------------------------------------------------------------- 1 | package school.management.system; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Many teachers, many students. 7 | * Implements teachers and student 8 | * using an ArrayList. 9 | * Created by Rakshith on 4/3/2017. 10 | */ 11 | public class School { 12 | 13 | private List teachers; 14 | private List students; 15 | private static int totalMoneyEarned; 16 | private static int totalMoneySpent; 17 | 18 | /** 19 | * new school object is created. 20 | * @param teachers list of teachers in the school. 21 | * @param students list of students int the school. 22 | */ 23 | public School(List teachers, List students) { 24 | this.teachers = teachers; 25 | this.students = students; 26 | totalMoneyEarned=0; 27 | totalMoneySpent=0; 28 | } 29 | 30 | /** 31 | * 32 | * @return the list of teachers int the school. 33 | */ 34 | public List getTeachers() { 35 | return teachers; 36 | } 37 | 38 | /** 39 | * Adds a teacher to the school. 40 | * @param teacher the teacher to be added. 41 | */ 42 | public void addTeacher(Teacher teacher) { 43 | teachers.add(teacher); 44 | } 45 | 46 | /** 47 | * 48 | * @return the list of students in the school. 49 | */ 50 | public List getStudents() { 51 | return students; 52 | } 53 | 54 | /** 55 | * Adds a student to the school 56 | * @param student the student to be added. 57 | */ 58 | public void addStudent(Student student) { 59 | students.add(student); 60 | } 61 | 62 | /** 63 | * 64 | * @return the total money earned by the school. 65 | */ 66 | public int getTotalMoneyEarned() { 67 | return totalMoneyEarned; 68 | } 69 | 70 | /** 71 | * Adds the total money earned by the school. 72 | * @param MoneyEarned money that is supposed to be added. 73 | */ 74 | public static void updateTotalMoneyEarned(int MoneyEarned) { 75 | totalMoneyEarned += MoneyEarned; 76 | } 77 | 78 | /** 79 | * 80 | * @return the total money spent by the school. 81 | */ 82 | public int getTotalMoneySpent() { 83 | return totalMoneySpent; 84 | } 85 | 86 | /** 87 | * update the money that is spent by the school which 88 | * is the salary given by the school to its teachers. 89 | * @param moneySpent the money spent by school. 90 | */ 91 | public static void updateTotalMoneySpent(int moneySpent) { 92 | totalMoneyEarned-=moneySpent; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/school/management/system/Student.java: -------------------------------------------------------------------------------- 1 | package school.management.system; 2 | 3 | /** 4 | * Created by Rakshith on 4/3/2017. 5 | * This class is responsible for keeping the 6 | * track of students fees, name ,grade & fees 7 | * paid. 8 | * 9 | */ 10 | public class Student { 11 | 12 | private int id; 13 | private String name; 14 | private int grade; 15 | private int feesPaid; 16 | private int feesTotal; 17 | 18 | /** 19 | * To create a new student by initializing. 20 | * Fees for every student is $30,000. 21 | * Fees paid initially is 0. 22 | * @param id id for the student: unique. 23 | * @param name name of the student. 24 | * @param grade grade of the student. 25 | */ 26 | public Student(int id, String name,int grade){ 27 | this.feesPaid=0; 28 | this.feesTotal=30000; 29 | this.id=id; 30 | this.name=name; 31 | this.grade=grade; 32 | 33 | } 34 | 35 | //Not going to alter student's name, student's id. 36 | 37 | 38 | /** 39 | * Used to update the student's grade. 40 | * @param grade new grade of the student. 41 | */ 42 | public void setGrade(int grade){ 43 | this.grade=grade; 44 | } 45 | 46 | 47 | /** 48 | * Keep adding the fees to feesPaid Field. 49 | * Add the fees to the fees paid. 50 | * The school is going receive the funds. 51 | * 52 | * @param fees the fees that the student pays. 53 | */ 54 | public void payFees(int fees){ 55 | feesPaid+=fees; 56 | School.updateTotalMoneyEarned(feesPaid); 57 | } 58 | 59 | /** 60 | * 61 | * @return id of the student. 62 | */ 63 | public int getId() { 64 | return id; 65 | } 66 | 67 | /** 68 | * 69 | * @return name of the student. 70 | */ 71 | public String getName() { 72 | return name; 73 | } 74 | 75 | /** 76 | * 77 | * @return the grade of the student. 78 | */ 79 | public int getGrade() { 80 | return grade; 81 | } 82 | 83 | /** 84 | * 85 | * @return fees paid by the student. 86 | */ 87 | public int getFeesPaid() { 88 | return feesPaid; 89 | } 90 | 91 | /** 92 | * 93 | * @return the total fees of the student. 94 | */ 95 | public int getFeesTotal() { 96 | return feesTotal; 97 | } 98 | 99 | /** 100 | * 101 | * @return the remaining fees. 102 | */ 103 | public int getRemainingFees(){ 104 | return feesTotal-feesPaid; 105 | } 106 | 107 | @Override 108 | public String toString() { 109 | return "Student's name :"+name+ 110 | " Total fees paid so far $"+ feesPaid; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 17 | 18 | 20 | 21 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 56 | 57 | 58 | 60 | 61 | 64 | 65 | 66 | 121 | 122 | 123 | 124 | 125 | true 126 | DEFINITION_ORDER 127 | 128 | 129 | 130 | 131 | 132 | 133 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | Android 147 | 148 | 149 | Android > Lint > Correctness 150 | 151 | 152 | Android > Lint > Performance 153 | 154 | 155 | CorrectnessLintAndroid 156 | 157 | 158 | GSPGrailsGroovy 159 | 160 | 161 | General 162 | 163 | 164 | GrailsGroovy 165 | 166 | 167 | Groovy 168 | 169 | 170 | Kotlin 171 | 172 | 173 | LintAndroid 174 | 175 | 176 | Maven 177 | 178 | 179 | Plugin DevKit 180 | 181 | 182 | XPath 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 |