Skip to content

Commit

Permalink
Rename UPDATE
Browse files Browse the repository at this point in the history
  • Loading branch information
hacimertgokhan committed Feb 8, 2024
1 parent bc3bd58 commit 7469862
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 60 deletions.
32 changes: 16 additions & 16 deletions src/main/java/net/hacimertgokhan/Main.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
package net.hacimertgokhan;

import net.hacimertgokhan.api.EconomgAPI;
import net.hacimertgokhan.bist.BIST;
import net.hacimertgokhan.bist.maths.PriceCalculators;
import net.hacimertgokhan.reader.FileReader;
import net.hacimertgokhan.utils.Logger;
import net.hacimertgokhan.bist.EconomgBIST;
import net.hacimertgokhan.bist.maths.EconomgPriceCalculators;
import net.hacimertgokhan.reader.EconomgFileReader;
import net.hacimertgokhan.utils.EconomgLogger;

import java.util.Scanner;
import static net.hacimertgokhan.bist.maths.Graphics.loadLastCalculateGraphic;
import static net.hacimertgokhan.bist.maths.EconomgGraphics.loadLastCalculateGraphic;

public class Main {
private static String key = "xxx";

static Logger logger = new Logger();
static EconomgLogger economgLogger = new EconomgLogger();
static EconomgAPI economgAPI = new EconomgAPI(key);
static FileReader fileReader = new FileReader();
static EconomgFileReader economgFileReader = new EconomgFileReader();

@Deprecated
public static void main(String[] args) {
fileReader.ReadLanguageFile();
economgFileReader.ReadLanguageFile();
Scanner selection = new Scanner(System.in);
logger.printp(":rstTest modu için :ylw'.test':rst, devam etmek için :ylw'.emg':rst");
economgLogger.printp(":rstTest modu için :ylw'.test':rst, devam etmek için :ylw'.emg':rst");
while (true) {
switch (selection.next()) {
case ".emg":
Scanner usercommand = new Scanner(System.in);
logger.printp(":rstFor more information :ylw'.help':rst");
economgLogger.printp(":rstFor more information :ylw'.help':rst");
switch (usercommand.nextLine()) {
case ".close":
logger.printn(String.format(":red %s :rst", fileReader.getLanguage("exit.0")));
economgLogger.printn(String.format(":red %s :rst", economgFileReader.getLanguage("exit.0")));
System.exit(0);
break;
case ".clear":
Expand All @@ -37,22 +37,22 @@ public static void main(String[] args) {
}
break;
case ".ipo":
PriceCalculators priceCalculators = new PriceCalculators(35, 15, "tr");
priceCalculators.InitialPublicOffering(25);
EconomgPriceCalculators economgPriceCalculators = new EconomgPriceCalculators(35, 15, "tr");
economgPriceCalculators.InitialPublicOffering(25);
break;
case ".graph":
loadLastCalculateGraphic();
break;
case ".help":
for(int i=0; i<4; i++) {
logger.printn(String.format(":red %s :rst", fileReader.getLanguage("help."+i)));
economgLogger.printn(String.format(":red %s :rst", economgFileReader.getLanguage("help."+i)));
}
break;
}
break;
case ".test":
BIST bist = new BIST();
bist.ContinuableFunction(true, "test", 5);
EconomgBIST economgBist = new EconomgBIST();
economgBist.ContinuableFunction(true, "test", 5);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/hacimertgokhan/api/EconomgAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import com.google.gson.*;
import kong.unirest.HttpResponse;
import kong.unirest.Unirest;
import net.hacimertgokhan.api.bist.BIST;
import net.hacimertgokhan.api.bist.EMGBIST;

import java.io.Serializable;
import java.util.HashMap;

public class EconomgAPI implements BIST {
public class EconomgAPI implements EMGBIST {
private HashMap<String, String> bist = new HashMap<String, String>();
private Object object;
private JsonObject jsonObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.Serializable;

public interface BIST {
public interface EMGBIST {

int getBIST100();
int getBIST50();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package net.hacimertgokhan.bist;


import net.hacimertgokhan.bist.interfaces.EconomicMathFunctions;
import net.hacimertgokhan.utils.Logger;
import net.hacimertgokhan.bist.interfaces.EMGEconomicMathFunctions;
import net.hacimertgokhan.utils.EconomgLogger;

import java.util.HashMap;
import java.util.Scanner;

public class BIST implements EconomicMathFunctions {
Logger logger = new Logger();
public class EconomgBIST implements EMGEconomicMathFunctions {
EconomgLogger economgLogger = new EconomgLogger();

/**
* @param isRunning
Expand All @@ -27,16 +27,16 @@ public int ContinuableFunction(boolean isRunning, String func, int num) {
continuableFunc.put(func, num);
} else {
Scanner ask = new Scanner(System.in);
logger.printn(":ylwYeni bir sürdürülebilir fonksiyon oluşturulsun mu ?");
economgLogger.printn(":ylwYeni bir sürdürülebilir fonksiyon oluşturulsun mu ?");
switch (ask.nextLine()) {
case "yes", "evet":
Scanner func_name = new Scanner(System.in);
logger.printn(":grnİşlem onaylandı, fonksiyona vereceğiniz anahtar isim nedir ?");
economgLogger.printn(":grnİşlem onaylandı, fonksiyona vereceğiniz anahtar isim nedir ?");
continuableFunc.put(func_name.nextLine().toString(), 0);
logger.printn(String.valueOf(continuableFunc.get(func_name.nextLine().toString())));
economgLogger.printn(String.valueOf(continuableFunc.get(func_name.nextLine().toString())));
break;
case "no", "hayır":
logger.printn(":redİşlem sonlandırılıyor...");
economgLogger.printn(":redİşlem sonlandırılıyor...");
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.hacimertgokhan.bist.interfaces;

public interface EconomicMathFunctions {
public interface EMGEconomicMathFunctions {

/*
Continuable Function mean is sustainable process package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
import java.util.ArrayList;
import java.util.Arrays;

public class Graphics {
public class EconomgGraphics {

public static void test_loadLastCalculateGraphic() {
ArrayList<Integer> f = new ArrayList<>();for(int g=1; g<100; g++) {f.add(g);}
PriceCalculators priceCalculators = new PriceCalculators(35, 10, "tr");
priceCalculators.InitialPublicOffering(11);
Arrays.sort(PriceCalculators.priceList.keySet().toArray(new String[0]));
EconomgPriceCalculators economgPriceCalculators = new EconomgPriceCalculators(35, 10, "tr");
economgPriceCalculators.InitialPublicOffering(11);
Arrays.sort(EconomgPriceCalculators.priceList.keySet().toArray(new String[0]));
ArrayList<String> newList = new ArrayList<>();
newList.add("\n");
for(int a = 1; a< PriceCalculators.priceList.size(); a++) {
for(int a = 1; a< EconomgPriceCalculators.priceList.size(); a++) {
double sayi = (double) a /4;
int intSayi = (int) sayi;
double doubleSayi = (double) intSayi;
if(sayi == doubleSayi) {
newList.add("\n");
} else {
newList.add(String.valueOf(PriceCalculators.priceList.get("prc_"+a).intValue()));
newList.add(String.valueOf(EconomgPriceCalculators.priceList.get("prc_"+a).intValue()));
}
}
System.out.println(" [Artış grafiği]");
Expand All @@ -31,17 +31,17 @@ public static void test_loadLastCalculateGraphic() {

public static void loadLastCalculateGraphic() {
ArrayList<Integer> f = new ArrayList<>();for(int g=1; g<100; g++) {f.add(g);}
Arrays.sort(PriceCalculators.priceList.keySet().toArray(new String[0]));
Arrays.sort(EconomgPriceCalculators.priceList.keySet().toArray(new String[0]));
ArrayList<String> newList = new ArrayList<>();
newList.add("\n");
for(int a = 1; a< PriceCalculators.priceList.size(); a++) {
for(int a = 1; a< EconomgPriceCalculators.priceList.size(); a++) {
double sayi = (double) a /4;
int intSayi = (int) sayi;
double doubleSayi = (double) intSayi;
if(sayi == doubleSayi) {
newList.add("\n");
} else {
newList.add(String.valueOf(PriceCalculators.priceList.get("prc_"+a).intValue()));
newList.add(String.valueOf(EconomgPriceCalculators.priceList.get("prc_"+a).intValue()));
}
}
System.out.println(" [Artış grafiği]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import java.util.HashMap;

import static net.hacimertgokhan.bist.maths.Graphics.loadLastCalculateGraphic;
import static net.hacimertgokhan.utils.ColorsMg.*;
import static net.hacimertgokhan.bist.maths.EconomgGraphics.loadLastCalculateGraphic;
import static net.hacimertgokhan.utils.EconomgColors.*;

public class PriceCalculators {
public class EconomgPriceCalculators {

private String type;
private double price;
Expand All @@ -21,7 +21,7 @@ public String getSymbol() {
};
}

public PriceCalculators(double price, double lots, String type) {
public EconomgPriceCalculators(double price, double lots, String type) {
this.price = price;
this.lots = lots;
this.type = type;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package net.hacimertgokhan.reader;

import net.hacimertgokhan.Main;
import net.hacimertgokhan.utils.Logger;

import java.io.*;
import java.util.Properties;

public class FileReader {
public class EconomgFileReader {
private Properties languageProperties = new Properties();
public FileReader(){}
public EconomgFileReader(){}

public void ReadLanguageFile(){
try (InputStream input = Main.class.getClassLoader().getResourceAsStream("language.properties")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package net.hacimertgokhan.utils;

public class ColorsMg {
public class EconomgColors {
public static String RESET = "\u001B[0m";
public static String RED = "\u001B[31m";
public static String GREEN = "\u001B[32m";
public static String YELLOW = "\u001B[33m";

public ColorsMg() {}
public EconomgColors() {}
public String getColor(String color) {
switch (color) {
case "reset":
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/net/hacimertgokhan/utils/EconomgLogger.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package net.hacimertgokhan.utils;

public class EconomgLogger {
public EconomgColors economgColors = new EconomgColors();

public EconomgLogger() {}
public void printp(String a) {
System.out.println(economgColors.Colorizer("[Economg]: ", "green") + a.replaceAll(":red", economgColors.getColor("red")).replaceAll(":rst", economgColors.getColor("reset")).replaceAll(":ylw", economgColors.getColor("yellow")).replaceAll(":grn", economgColors.getColor("green")));
}
public void printn(String a) {
System.out.println(a.replaceAll(":red", economgColors.getColor("red")).replaceAll(":rst", economgColors.getColor("reset")).replaceAll(":ylw", economgColors.getColor("yellow")).replaceAll(":grn", economgColors.getColor("green")));
}

}
14 changes: 0 additions & 14 deletions src/main/java/net/hacimertgokhan/utils/Logger.java

This file was deleted.

0 comments on commit 7469862

Please sign in to comment.