From ab884daf398f171c5e60b4a566c5ea9c1bbd05f3 Mon Sep 17 00:00:00 2001 From: Ray Liu <rayliu109@gmail.com> Date: Tue, 27 Mar 2018 22:59:09 -0400 Subject: [PATCH] Finished hisogram and documentation and windows script --- src/data/TaxonType.java | 4 ++-- src/search/Histogram.java | 18 ++++++++++++------ src/sort/Bound.java | 6 +++++- tomcat/windows-script.py | 25 ++++++++++++------------- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/src/data/TaxonType.java b/src/data/TaxonType.java index 008c128..a5b2f4c 100644 --- a/src/data/TaxonType.java +++ b/src/data/TaxonType.java @@ -1,12 +1,12 @@ package data; /** - * Enumeration of classifications of Taxa. + * Enumeration of classifications of Taxontype. * @author Christopher W. Schankula * */ -//Changed to only capitalizing the first character + public enum TaxonType { Kingdom, Phylum, Class, Order, Family, Genus, Species, Subspecies; diff --git a/src/search/Histogram.java b/src/search/Histogram.java index 3e8ef10..f8d145e 100644 --- a/src/search/Histogram.java +++ b/src/search/Histogram.java @@ -38,12 +38,18 @@ public class Histogram { int max = 0; int scale = 100; Iterable<Integer> results = record.keys(); + + //Finds the max individual count for (Integer year: results) { if (max < record.get(year)) max =record.get(year); } + + //Based the scale on the max System.out.println(" |" + (new String(new char[scale]).replace('\0', '-')) + "|"); String format = "%1$-5d|%2$-" + (scale + 1) + "s"; + + //Print out histogram based on scale for (Integer year: results) { String s = "="; int loopc = (int) ((float)(record.get(year)/ (float) max) * scale); @@ -56,7 +62,11 @@ public class Histogram { System.out.format("Scale: one = is %d individuals.\n", max / scale); } - + /** + * Gets the count of the record + * + * @param sum count of the record + */ public static int sum(Iterable<Record> records) { int sum = 0; for (Record r: records) @@ -64,8 +74,4 @@ public class Histogram { return sum; } - public static void main(String[] args) { - - } - -} + \ No newline at end of file diff --git a/src/sort/Bound.java b/src/sort/Bound.java index 990bac2..d6b4b7f 100644 --- a/src/sort/Bound.java +++ b/src/sort/Bound.java @@ -1,5 +1,9 @@ package sort; - +/** + * Enumeration of bound types. + * @author Christopher W. Schankula + * + */ public enum Bound { LOWER, UPPER, LOWHIGH, ANY, EQUALS; } diff --git a/tomcat/windows-script.py b/tomcat/windows-script.py index f19d8f6..fc7b96d 100644 --- a/tomcat/windows-script.py +++ b/tomcat/windows-script.py @@ -1,25 +1,24 @@ import subprocess -pathToTomcat = "C:\\Users\\liang\\Documents\\Git\\Trawl\\src\\tomcat" # REPLACE ME - CUSTOM +pathToTomcat = "\"C:\\Users\\Ray Liu\\Desktop\\Uni\\Second year\\2xb3\\2XB3" # REPLACE ME - CUSTOM -pathToSrc = "\\webapps\\Trawl\\bin\\com\\example\\" -pathToFin = "\\webapps\\Trawl\\WEB-INF\\classes\\com\\example\\" -pathClasspath = pathToTomcat + "\\lib\\servlet-api.jar;" + pathToTomcat + "\\webapps\\Trawl\\bin" +pathToSrc = "\\bin\"" +pathToFin = "\\tomcat\\webapps\\Trawl\\WEB-INF\\classes\"" +#pathClasspath = pathToTomcat + "\\lib\\servlet-api.jar;" + pathToTomcat + "\\webapps\\Trawl\\bin" -compileCMD1 = "javac -cp " + pathClasspath + " " + pathToTomcat + pathToSrc + "web\\Director.java" -compileCMD2 = "javac -cp " + pathClasspath + " " + pathToTomcat + pathToSrc + "model\\TrawlExpert.java" +# compileCMD1 = "javac -cp " + pathClasspath + " " + pathToTomcat + pathToSrc + "web\\Director.java" +# compileCMD2 = "javac -cp " + pathClasspath + " " + pathToTomcat + pathToSrc + "model\\TrawlExpert.java" # print(compileCMD1) # print(compileCMD2) -copyCMD1 = "copy " + pathToTomcat + pathToSrc + "web\\Director.class" + " " + pathToTomcat + pathToFin + "web\\Director.class" -copyCMD2 = "copy " + pathToTomcat + pathToSrc + "model\\TrawlExpert.class" + " " + pathToTomcat + pathToFin + "model\\TrawlExpert.class" +copyCMD1 = "xcopy " + pathToTomcat + pathToSrc + " " + pathToTomcat + pathToFin + " " + "/E" + + +#print(copyCMD1) -# print(copyCMD1) -# print(copyCMD2) # Command Processes -subprocess.call(compileCMD1, shell=True) -subprocess.call(compileCMD2, shell=True) + subprocess.call(copyCMD1, shell=True) -subprocess.call(copyCMD2, shell=True) \ No newline at end of file + -- GitLab