From c7409b3eaeb0ffe20d047cf9dc88df3d94942984 Mon Sep 17 00:00:00 2001 From: Castle Anzalone Date: Sat, 10 Oct 2020 23:37:39 -0500 Subject: [PATCH 1/2] all functions complete --- .classpath | 49 +++ .project | 23 ++ .settings/org.eclipse.jdt.apt.core.prefs | 2 + .settings/org.eclipse.jdt.core.prefs | 16 + .settings/org.eclipse.jdt.ui.prefs | 74 ++++ .settings/org.eclipse.m2e.core.prefs | 4 + pom.xml | 5 + .../CodingCompCsvUtil.java | 342 ++++++++++++++---- .../structures/Agent.java | 39 +- .../structures/Claim.java | 32 +- .../structures/Customer.java | 99 ++++- .../structures/Dependent.java | 12 + .../structures/Vendor.java | 33 +- target/classes/META-INF/MANIFEST.MF | 4 +- .../coding-competition/pom.properties | 8 +- .../coding-competition/pom.xml | 5 + .../CodingCompCsvUtil.class | Bin 3251 -> 12486 bytes .../structures/Agent.class | Bin 428 -> 1330 bytes .../structures/Claim.class | Bin 397 -> 1292 bytes .../structures/Customer.class | Bin 806 -> 3638 bytes .../structures/Dependent.class | Bin 384 -> 662 bytes .../structures/Vendor.class | Bin 419 -> 1313 bytes .../CodingCompCsvUtilTest.class | Bin 3972 -> 5230 bytes 23 files changed, 666 insertions(+), 81 deletions(-) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.jdt.apt.core.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.jdt.ui.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..39abf1c --- /dev/null +++ b/.classpath @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..5edc1ee --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + coding-competition + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.jdt.apt.core.prefs b/.settings/org.eclipse.jdt.apt.core.prefs new file mode 100644 index 0000000..d4313d4 --- /dev/null +++ b/.settings/org.eclipse.jdt.apt.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=false diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..ea7a397 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,16 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..25c0923 --- /dev/null +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,74 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.lazy_logical_operator=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.merge_conditional_blocks=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.number_suffix=false +sp_cleanup.objects_equals=false +sp_cleanup.on_save_use_additional_actions=false +sp_cleanup.organize_imports=true +sp_cleanup.precompile_regex=false +sp_cleanup.push_down_negation=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_modifiers=false +sp_cleanup.remove_redundant_semicolons=false +sp_cleanup.remove_redundant_type_arguments=false +sp_cleanup.remove_trailing_whitespaces=false +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_array_creation=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.simplify_lambda_expression_and_method_ref=false +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_autoboxing=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_directly_map_method=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true +sp_cleanup.use_unboxing=false +sp_cleanup.use_var=false diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/pom.xml b/pom.xml index 21d55bf..daa4bce 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,11 @@ jackson-dataformat-csv 2.11.2 + + com.google.code.gson + gson + 2.8.6 + diff --git a/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java b/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java index 58267da..32636f8 100644 --- a/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java +++ b/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java @@ -1,147 +1,353 @@ package sf.codingcompetition2020; -import java.io.FileReader; -import java.io.Reader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InvalidClassException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.atomic.AtomicInteger; +import java.util.Scanner; import java.util.stream.Collectors; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.MappingIterator; -import com.fasterxml.jackson.databind.ObjectReader; -import com.fasterxml.jackson.dataformat.csv.CsvMapper; -import com.fasterxml.jackson.dataformat.csv.CsvSchema; - import sf.codingcompetition2020.structures.Agent; import sf.codingcompetition2020.structures.Claim; import sf.codingcompetition2020.structures.Customer; import sf.codingcompetition2020.structures.Vendor; public class CodingCompCsvUtil { - - /* #1 - * readCsvFile() -- Read in a CSV File and return a list of entries in that file. + + /* + * #1 readCsvFile() -- Read in a CSV File and return a list of entries in that + * file. + * * @param filePath -- Path to file being read in. + * * @param classType -- Class of entries being read in. + * * @return -- List of entries being returned. */ public List readCsvFile(String filePath, Class classType) { + Class myClass = classType.getClass(); + List list = new ArrayList(); + + File in = new File(filePath); + Scanner readMe = new Scanner(System.in); + try { + readMe = new Scanner(in); + String line = ""; + if (readMe.hasNextLine()) { + line = readMe.nextLine(); + } + while (readMe.hasNextLine()) { + line = readMe.nextLine(); + + if (classType.equals(Agent.class)) { + list.add((T) Agent.parseFromString(line)); + } else if (classType.equals(Claim.class)) { + list.add((T) Claim.parseFromString(line)); + } else if (classType.equals(Customer.class)) { + list.add((T) Customer.parseFromString(line)); + } else if (classType.equals(Vendor.class)) { + list.add((T) Vendor.parseFromString(line)); + } else { + throw new InvalidClassException("Cannot convert to class: " + classType.toString()); + } + } + } catch (FileNotFoundException e) { + System.out.println("No file found at " + filePath); + } catch (IOException e) { + System.out.println(e.getMessage()); + } + readMe.close(); + return list; + } + + private List getStructInArea(String filePath, String area, Class classType) throws InvalidClassException { + List list = readCsvFile(filePath, classType); + List listarea = new ArrayList(); + String s = ""; + for (T struct : list) { + if (classType.equals(Agent.class)) { + s = ((Agent) struct).getArea(); + } else if (classType.equals(Claim.class)) { + throw new InvalidClassException("Cannot get on area of class" + classType.toString()); + } else if (classType.equals(Customer.class)) { + s = ((Customer) struct).getArea(); + } else if (classType.equals(Vendor.class)) { + s = ((Vendor) struct).getArea(); + } + if (s.equals(area)) { + listarea.add(struct); + } + } + return listarea; } - - /* #2 - * getAgentCountInArea() -- Return the number of agents in a given area. + /* + * #2 getAgentCountInArea() -- Return the number of agents in a given area. + * * @param filePath -- Path to file being read in. + * * @param area -- The area from which the agents should be counted. + * * @return -- The number of agents in a given area */ - public int getAgentCountInArea(String filePath,String area) { + public int getAgentCountInArea(String filePath, String area) { + int result = 0; + try { + result = (int) getStructInArea(filePath, area, Agent.class).size(); + } catch (InvalidClassException e) { + System.out.println("Should Not Happen: " + e.getMessage()); + throw new RuntimeException(e.getMessage()); + } + return result; + } + + // TODO:this + public void getallareas(String agentFilePath) { } - - /* #3 - * getAgentsInAreaThatSpeakLanguage() -- Return a list of agents from a given area, that speak a certain language. + /* + * #3 getAgentsInAreaThatSpeakLanguage() -- Return a list of agents from a given + * area, that speak a certain language. + * * @param filePath -- Path to file being read in. + * * @param area -- The area from which the agents should be counted. + * * @param language -- The language spoken by the agent(s). + * * @return -- The number of agents in a given area */ public List getAgentsInAreaThatSpeakLanguage(String filePath, String area, String language) { - + List agents = new ArrayList(); + try { + agents = getStructInArea(filePath, area, Agent.class); + } catch (Exception e) { + System.out.println("Should Not Happen: " + e.getMessage()); + } + List result = new ArrayList(); + for (Agent agent : agents) { + if (agent.getLanguage().equals(language)) { + result.add(agent); + } + } + return result; } - - - /* #4 - * countCustomersFromAreaThatUseAgent() -- Return the number of individuals from an area that use a certain agent. + + /* + * #4 countCustomersFromAreaThatUseAgent() -- Return the number of individuals + * from an area that use a certain agent. + * * @param filePath -- Path to file being read in. + * * @param customerArea -- The area from which the customers should be counted. + * * @param agentFirstName -- First name of agent. + * * @param agentLastName -- Last name of agent. + * * @return -- The number of customers that use a certain agent in a given area. */ - public short countCustomersFromAreaThatUseAgent(Map csvFilePaths, String customerArea, String agentFirstName, String agentLastName) { - + public short countCustomersFromAreaThatUseAgent(Map csvFilePaths, String customerArea, + String agentFirstName, String agentLastName) { + List custs = new ArrayList(); + List agents = new ArrayList(); + String filePath1 = csvFilePaths.get("customerList"); + String filePath2 = csvFilePaths.get("agentList"); + short count = 0; + try { + custs = getStructInArea(filePath1, customerArea, Customer.class); + agents = readCsvFile(filePath2, Agent.class); + } catch (Exception e) { + System.out.println("Should Not Happen: " + e.getMessage()); + } + + for (Customer cust : custs) { + for (Agent agent : agents) { + if (cust.getAgentId() == agent.getAgentId() && agent.getFirstName().equals(agentFirstName) + && agent.getLastName().equals(agentLastName)) { + count++; + } + } + } + return count; } - - /* #5 - * getCustomersRetainedForYearsByPlcyCostAsc() -- Return a list of customers retained for a given number of years, in ascending order of their policy cost. + /* + * #5 getCustomersRetainedForYearsByPlcyCostAsc() -- Return a list of customers + * retained for a given number of years, in ascending order of their policy + * cost. + * * @param filePath -- Path to file being read in. + * * @param yearsOfServeice -- Number of years the person has been a customer. - * @return -- List of customers retained for a given number of years, in ascending order of policy cost. + * + * @return -- List of customers retained for a given number of years, in + * ascending order of policy cost. */ public List getCustomersRetainedForYearsByPlcyCostAsc(String customerFilePath, short yearsOfService) { - + List custs = readCsvFile(customerFilePath, Customer.class); + List resultCusts = new ArrayList(); + for (Customer cust : custs) { + if (cust.getYearsOfService() == yearsOfService) { + resultCusts.add(cust); + } + } + resultCusts = resultCusts.stream().sorted((a, b) -> { + return Integer.compare(Integer.parseInt(a.getTotalMonthlyPremium().replaceAll("\\$", "")), + Integer.parseInt(b.getTotalMonthlyPremium().replaceAll("\\$", ""))); + }).collect(Collectors.toList()); + return resultCusts; } - - /* #6 - * getLeadsForInsurance() -- Return a list of individuals who’ve made an inquiry for a policy but have not signed up. - * *HINT* -- Look for customers that currently have no policies with the insurance company. + /* + * #6 getLeadsForInsurance() -- Return a list of individuals who’ve made an + * inquiry for a policy but have not signed up. *HINT* -- Look for customers + * that currently have no policies with the insurance company. + * * @param filePath -- Path to file being read in. - * @return -- List of customers who’ve made an inquiry for a policy but have not signed up. + * + * @return -- List of customers who’ve made an inquiry for a policy but have + * not signed up. */ public List getLeadsForInsurance(String filePath) { - + List custs = readCsvFile(filePath, Customer.class); + List resultCusts = new ArrayList(); + for (Customer cust : custs) { + if (!(cust.isAutoPolicy() || cust.isHomePolicy() || cust.isRentersPolicy())) { + resultCusts.add(cust); + } + } + return resultCusts; } - - /* #7 - * getVendorsWithGivenRatingThatAreInScope() -- Return a list of vendors within an area and include options to narrow it down by: - a. Vendor rating - b. Whether that vendor is in scope of the insurance (if inScope == false, return all vendors in OR out of scope, if inScope == true, return ONLY vendors in scope) + /* + * #7 getVendorsWithGivenRatingThatAreInScope() -- Return a list of vendors + * within an area and include options to narrow it down by: a. Vendor rating b. + * Whether that vendor is in scope of the insurance (if inScope == false, return + * all vendors in OR out of scope, if inScope == true, return ONLY vendors in + * scope) + * * @param filePath -- Path to file being read in. + * * @param area -- Area of the vendor. + * * @param inScope -- Whether or not the vendor is in scope of the insurance. + * * @param vendorRating -- The rating of the vendor. - * @return -- List of vendors within a given area, filtered by scope and vendor rating. + * + * @return -- List of vendors within a given area, filtered by scope and vendor + * rating. */ - public List getVendorsWithGivenRatingThatAreInScope(String filePath, String area, boolean inScope, int vendorRating) { - + public List getVendorsWithGivenRatingThatAreInScope(String filePath, String area, boolean inScope, + int vendorRating) { + List vendors = new ArrayList(); + List resultvendors = new ArrayList(); + try { + vendors = getStructInArea(filePath, area, Vendor.class); + } catch (Exception e) { + System.out.println("Should Not Happen: " + e.getMessage()); + } + for (Vendor vendor : vendors) { + if (vendor.getVendorRating() >= vendorRating && ((inScope && vendor.isInScope()) || !inScope)) { + resultvendors.add(vendor); + } + } + return resultvendors; } - - /* #8 - * getUndisclosedDrivers() -- Return a list of customers between the age of 40 and 50 years (inclusive), who have: - a. More than X cars - b. less than or equal to X number of dependents. + /* + * #8 getUndisclosedDrivers() -- Return a list of customers between the age of + * 40 and 50 years (inclusive), who have: a. More than X cars b. less than or + * equal to X number of dependents. + * * @param filePath -- Path to file being read in. + * * @param vehiclesInsured -- The number of vehicles insured. + * * @param dependents -- The number of dependents on the insurance policy. - * @return -- List of customers filtered by age, number of vehicles insured and the number of dependents. + * + * @return -- List of customers filtered by age, number of vehicles insured and + * the number of dependents. */ public List getUndisclosedDrivers(String filePath, int vehiclesInsured, int dependents) { + List custs = readCsvFile(filePath, Customer.class); + List resultcusts = new ArrayList(); + for (Customer cust : custs) { + if (cust.getAge() >= 40 && cust.getAge() <= 50 && cust.getVehiclesInsured() > vehiclesInsured) { + if ((cust.getDependents() != null && cust.getDependents().size() <= dependents) + || (cust.getDependents() == null && 0 <= dependents)) { + resultcusts.add(cust); + } + } + } + return resultcusts; + } - } - - - /* #9 - * getAgentIdGivenRank() -- Return the agent with the given rank based on average customer satisfaction rating. - * *HINT* -- Rating is calculated by taking all the agent rating by customers (1-5 scale) and dividing by the total number - * of reviews for the agent. + /* + * #9 getAgentIdGivenRank() -- Return the agent with the given rank based on + * average customer satisfaction rating. *HINT* -- Rating is calculated by + * taking all the agent rating by customers (1-5 scale) and dividing by the + * total number of reviews for the agent. + * * @param filePath -- Path to file being read in. + * * @param agentRank -- The rank of the agent being requested. + * * @return -- Agent ID of agent with the given rank. */ public int getAgentIdGivenRank(String filePath, int agentRank) { - - } + List agents = readCsvFile(filePath, Agent.class); + HashMap ratings = new HashMap(); + int agentID = 0; + List custs = readCsvFile(filePath, Customer.class); + for (Customer cust : custs) { + if (!ratings.containsKey(cust.getAgentId())) { + ratings.put(cust.getAgentId(), (int) cust.getAgentRating()); + } else { + ratings.put(cust.getAgentId(), (ratings.get(cust.getAgentId()) + cust.getAgentRating()) / 2); + } + } + for (Agent agent : agents) { + if (ratings.get(agent.getAgentId()) != null && ratings.get(agent.getAgentId()) == agentRank) { + agentID = agent.getAgentId(); + } + } + return agentID; + } - - /* #10 - * getCustomersWithClaims() -- Return a list of customers who’ve filed a claim within the last (inclusive). + /* + * #10 getCustomersWithClaims() -- Return a list of customers who’ve filed a + * claim within the last (inclusive). + * * @param filePath -- Path to file being read in. + * * @param monthsOpen -- Number of months a policy has been open. - * @return -- List of customers who’ve filed a claim within the last . + * + * @return -- List of customers who’ve filed a claim within the last + * . */ - public List getCustomersWithClaims(Map csvFilePaths, short monthsOpen) { - - } + public List getCustomersWithClaims(Map csvFilePaths, short monthsOpen) { + String filePath1 = csvFilePaths.get("customerList"); + String filePath2 = csvFilePaths.get("claimList"); + List custs = readCsvFile(filePath1, Customer.class); + List claims = readCsvFile(filePath2, Claim.class); + List resultcusts = new ArrayList(); + for (Claim claim : claims) { + for (Customer cust : custs) { + if (claim.getCustomerId() == cust.getCustomerId() && claim.getMonthsOpen() <= monthsOpen) { + if (!resultcusts.contains(cust)) { + resultcusts.add(cust); + } + } + } + } + return resultcusts; + } } diff --git a/src/main/java/sf/codingcompetition2020/structures/Agent.java b/src/main/java/sf/codingcompetition2020/structures/Agent.java index e2e6f93..d4987c5 100644 --- a/src/main/java/sf/codingcompetition2020/structures/Agent.java +++ b/src/main/java/sf/codingcompetition2020/structures/Agent.java @@ -1,11 +1,46 @@ package sf.codingcompetition2020.structures; public class Agent { - + private int agentId; private String area; private String language; private String firstName; private String lastName; - + + private Agent() { + // blank + } + + public static Agent parseFromString(String line) { + Agent agent = new Agent(); + String[] arr = line.split(","); + agent.agentId = Integer.parseInt(arr[0]); + agent.area = arr[1]; + agent.language = arr[2]; + agent.firstName = arr[3]; + agent.lastName = arr[4]; + + return agent; + } + + public int getAgentId() { + return agentId; + } + + public String getArea() { + return area; + } + + public String getLanguage() { + return language; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } } diff --git a/src/main/java/sf/codingcompetition2020/structures/Claim.java b/src/main/java/sf/codingcompetition2020/structures/Claim.java index 581140a..5631ac2 100644 --- a/src/main/java/sf/codingcompetition2020/structures/Claim.java +++ b/src/main/java/sf/codingcompetition2020/structures/Claim.java @@ -5,5 +5,35 @@ public class Claim { private int customerId; private boolean closed; private int monthsOpen; - + + private Claim() { + // blank + } + + public static Claim parseFromString(String line) { + Claim claim = new Claim(); + String[] arr = line.split(","); + claim.claimId = Integer.parseInt(arr[0]); + claim.customerId = Integer.parseInt(arr[1]); + claim.closed = Boolean.parseBoolean(arr[2]); + claim.monthsOpen = Integer.parseInt(arr[3]); + + return claim; + } + + public int getClaimId() { + return claimId; + } + + public int getCustomerId() { + return customerId; + } + + public boolean isClosed() { + return closed; + } + + public int getMonthsOpen() { + return monthsOpen; + } } diff --git a/src/main/java/sf/codingcompetition2020/structures/Customer.java b/src/main/java/sf/codingcompetition2020/structures/Customer.java index f151906..dc181a5 100644 --- a/src/main/java/sf/codingcompetition2020/structures/Customer.java +++ b/src/main/java/sf/codingcompetition2020/structures/Customer.java @@ -3,9 +3,8 @@ import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; public class Customer { private int customerId; @@ -24,4 +23,98 @@ public class Customer { private short yearsOfService; private Integer vehiclesInsured; + private Customer() { + // blank + } + + public static Customer parseFromString(String line) { + Customer customer = new Customer(); + // https://stackoverflow.com/questions/18893390/splitting-on-comma-outside-quotes + // for regex + String[] arr = line.split(",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)"); + Gson son = new Gson(); + customer.customerId = Integer.parseInt(arr[0]); + customer.firstName = arr[1]; + customer.lastName = arr[2]; + customer.age = Integer.parseInt(arr[3]); + customer.area = arr[4]; + customer.agentId = Integer.parseInt(arr[5]); + customer.agentRating = Short.parseShort(arr[6]); + customer.primaryLanguage = arr[7]; + customer.dependents = new ArrayList(); + try { + customer.dependents = son.fromJson(arr[8], ArrayList.class); + } catch (JsonSyntaxException e) { + System.out.print(arr[8]); + } + customer.homePolicy = Boolean.parseBoolean(arr[9]); + customer.autoPolicy = Boolean.parseBoolean(arr[10]); + customer.rentersPolicy = Boolean.parseBoolean(arr[11]); + customer.totalMonthlyPremium = arr[12]; + customer.yearsOfService = Short.parseShort(arr[13]); + customer.vehiclesInsured = Integer.parseInt(arr[14]); + + return customer; + } + + public int getCustomerId() { + return customerId; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public int getAge() { + return age; + } + + public String getArea() { + return area; + } + + public int getAgentId() { + return agentId; + } + + public short getAgentRating() { + return agentRating; + } + + public String getPrimaryLanguage() { + return primaryLanguage; + } + + public List getDependents() { + return dependents; + } + + public boolean isHomePolicy() { + return homePolicy; + } + + public boolean isAutoPolicy() { + return autoPolicy; + } + + public boolean isRentersPolicy() { + return rentersPolicy; + } + + public String getTotalMonthlyPremium() { + return totalMonthlyPremium; + } + + public short getYearsOfService() { + return yearsOfService; + } + + public Integer getVehiclesInsured() { + return vehiclesInsured; + } + } diff --git a/src/main/java/sf/codingcompetition2020/structures/Dependent.java b/src/main/java/sf/codingcompetition2020/structures/Dependent.java index d4deb1a..ac10374 100644 --- a/src/main/java/sf/codingcompetition2020/structures/Dependent.java +++ b/src/main/java/sf/codingcompetition2020/structures/Dependent.java @@ -4,4 +4,16 @@ public class Dependent { private String firstName; private String lastName; + public Dependent(String firstName, String lastName) { + this.firstName = firstName; + this.firstName = lastName; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } } diff --git a/src/main/java/sf/codingcompetition2020/structures/Vendor.java b/src/main/java/sf/codingcompetition2020/structures/Vendor.java index 6b6fb76..aed96a9 100644 --- a/src/main/java/sf/codingcompetition2020/structures/Vendor.java +++ b/src/main/java/sf/codingcompetition2020/structures/Vendor.java @@ -5,5 +5,36 @@ public class Vendor { private String area; private int vendorRating; private boolean inScope; - + + private Vendor() { + // blank + } + + public static Vendor parseFromString(String line) { + Vendor vendor = new Vendor(); + String[] arr = line.split(","); + vendor.vendorId = Integer.parseInt(arr[0]); + vendor.area = arr[1]; + vendor.vendorRating = Integer.parseInt(arr[2]); + vendor.inScope = Boolean.parseBoolean(arr[3]); + + return vendor; + } + + public int getVendorId() { + return vendorId; + } + + public String getArea() { + return area; + } + + public int getVendorRating() { + return vendorRating; + } + + public boolean isInScope() { + return inScope; + } + } diff --git a/target/classes/META-INF/MANIFEST.MF b/target/classes/META-INF/MANIFEST.MF index e2a1a34..7e88af8 100644 --- a/target/classes/META-INF/MANIFEST.MF +++ b/target/classes/META-INF/MANIFEST.MF @@ -1,5 +1,5 @@ Manifest-Version: 1.0 -Built-By: yc1d -Build-Jdk: 1.8.0_201 +Built-By: Castle +Build-Jdk: 14.0.2 Created-By: Maven Integration for Eclipse diff --git a/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties b/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties index fe569e3..ed6c4fd 100644 --- a/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties +++ b/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties @@ -1,7 +1,7 @@ #Generated by Maven Integration for Eclipse -#Thu Oct 08 09:27:33 MST 2020 -version=1.0.0-SNAPSHOT -groupId=sf.codingcompetition2020 +#Sat Oct 10 22:19:11 CDT 2020 +m2e.projectLocation=C\:\\Users\\Castle\\Desktop\\Desktop\\Spring\\sts-4.8.0.RELEASE\\Workspace\\202codecomp\\git m2e.projectName=coding-competition -m2e.projectLocation=/Users/yc1d/Development/coding-competition/problem/online-competition +groupId=sf.codingcompetition2020 artifactId=coding-competition +version=1.0.0-SNAPSHOT diff --git a/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.xml b/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.xml index 21d55bf..daa4bce 100644 --- a/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.xml +++ b/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.xml @@ -27,6 +27,11 @@ jackson-dataformat-csv 2.11.2 + + com.google.code.gson + gson + 2.8.6 + diff --git a/target/classes/sf/codingcompetition2020/CodingCompCsvUtil.class b/target/classes/sf/codingcompetition2020/CodingCompCsvUtil.class index 00daba9d49249e6950fa6b4b75732ac294bb504b..9ea877f4f6635be588e99c796c8148d8ecdf72fa 100644 GIT binary patch literal 12486 zcmb_j31D31ah{QO_pMgXmu%TyAF_OatqU0&%VuQ@%fg3*ED1{%*nnZZT1ksnyJB}G z5Rh=#+#w{GCfE?LxdefR@{(1AyKl9Bu^Z&bf_p?`DBchA=X@hc@O4FT{kz_|K(G^Md^hPtWOe~pLv3$ky z$~yJ54o~aS{o6CKxIrGKsn>`5!q%WaoK9Dl=qG(xQe|T-oq?9T)>u~}oaswJ$M&^tA=f*4 zmDM#9(7d*-t-5B6di_)!GTo#ZRLJD-ie{84Ow*TH)+mo^`wW_e0ksZgV{IxG9uPwV zG?VfSn!{wO(O9xlmK~rV%@beGXDS@W%#wD47BEfAYHW>!6NzXlj~3EmgBFd5YU@Bc z6YVi+37yB36H7p+_6BCFPxSU>;MQokr#e7Iv{YtY#x&cSb(Ba+y9kwvP#NaW3W?R# zCGCEyU?P#JG-)|qh-h|)(@oKvGJ+U|r=2po(xi)M75tWPhGvZLn-yt;Rx_2H7Cz}r zsxKljPFL1;MH6smE?sO=hyVaz^oG809Pk_AKr8kou%e3AnN&lU0M5PPR64pTmF&^e zGF>vB(@ziM(RNhlQ!UjQw1H`IHbxR~lP(qGa>E@R25p+)+5nanYPLFtxW6B zd3vo2lW%95Z|7TmqCXsub*Mz$cvB?WD|Bhl6-={~h)QFPiw%9Tct?G z3#3*=H=1;l6cBGDo=is#y4e*7p^&CzW|J7>r~yTYi7nwww-lMt9uT5eZf_gt1-(pj z2`Fb{+~^rlmndU#Bp{ek3%QHMWQPwGk0B6JgSJBBbeFKjvCs)k!e)&BEg13Y82cfd zjeyHNcs_Gv$;1MzvN=<$%+?QGZyZgI<@WPQt(kCS&(?6SQee;*N7BD4ngAj~0o;Hv z>l3wDAJgV>Q0AIjgKR?8HsAydaOgUha(kM|&Rl?*9x-V$O%b~Nib-FkM}e1ECYlOo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m+~;6Fe{8dI`l} z@S*?#9_?d*D;NxLei(q~*YJ+O>u>?1F5-0o-pC;L5pChYZ?N)g5d`y+cgA%#<< zz>(g9w~=RM{FCsGhj80Vcn{upT0U^31*awSkREzT>+qo?U2~*GN4oAIJ@%4r!iFQ2 z9BJYYIz8jho|kk7K60eHj#O}(e53;}sSKNrbkC6{*=>0=aWCmUJaD8>9BJaXPty-x g(nENZyZS$Q37^8Y(^7F-{@dxFy`(C7T7b{~2FpNm>;M1& diff --git a/target/classes/sf/codingcompetition2020/structures/Agent.class b/target/classes/sf/codingcompetition2020/structures/Agent.class index 26bf31f236fb6fb54997543cc9d682faad0ab137..fa8efea264270fa149d898db7fb892dbefedeef4 100644 GIT binary patch literal 1330 zcmb7DQBTuQ7(I7v>sG3R0Sbyb5usb_iW5ZzHO6Ggl8Fx(65~@DWtMC!X*>Ui|HB7O zM2sf>0DqM6+*@D~`k*iO`|j;`?)lDlPk;UX{u96|o@mGjRHHqo6YTnfZYSs;c(EV* z!Jx6ySaG5_9CqSi=ta)+t~ZD^WCbSn-S@83a|d1L)y}@xi3K!Qer@dvh?YRs4Lw(& z+#VHf#UZa>7br;FkmUl!JwJ@%O}EdS$0uoi!yowZQ-LwFy3Na81iPM&F-#aRa6zEd z_6OePu)pJluic##+pT)7e(t#UBUNa2(Ny7rq%=0R$ z|8b`d4y=GVPR7=871uP(|24vd$iQ{n5XeObJ)iSjPGfz0z7ricaZAI3z~pGwtwHQ{ zz0klSZga9q63+x?(r#@P+2OK*9P%=&8qiRXnPs4uWOoecN#+1-k0)-?w}N5V@tVFg zg06__augg4>1gsCGEy6}j8vu~b*V^IDpC_8{{`tV;x2M`k5Mq@YDXx2R%Mf1bryj` z$g;4^%t(qbg=y}Jn8Bsv3qFuuHn8>s;>{5*w`=9uuekEkvd0?VP&vesWoH|QFfBXB zP_yhjgKgOwL*4pBXaqljz?D?+!&GqXEO;>${3sP{p9Pz# S;K!-p`dP4@3SL)}+4uvPyzYwt delta 89 zcmdnQwT4;X)W2Q(7#J7~8N}Hcm>3x}Cp$7~PPBY5`81Qa4kH620}lf)kmLg@(Ff9u fK$=x+I|KhlAcKiP5J<9t1(_$uvxu^bf0Qz^%xq|;8?j=$lL_@If1 z(Zmn%qm1jclK^8)G?UEPXJ6LZd!N;xzrOtdu!`qJWCY6LThsQB9It8nt+tGu$nm}E za&_4Zqo89)oj``>mTNh!B60#lC)PX5bS;r|ktfPcJ zWmR=(DDX*LzMy)x^Pan#-NN^()r}d6k@St1B=j zP+}@!=Yq<#J--v!a@$b?(qgnF)effFXqI0=4jHu*S{b#G_~ab%$tidi7@;DW-_P3v zo`Pq7;S2+x;C6`!pMkPSg9S^>5cc1_lO02C<1;KPJCna^`1bU}WHC-~p1nKneZHcFbbzY(O3Z1M}n$ NETZfpKo%2&C;-$@3q1e; diff --git a/target/classes/sf/codingcompetition2020/structures/Customer.class b/target/classes/sf/codingcompetition2020/structures/Customer.class index 844ea29474f5bc9dd328dee078d97b0567ad1de8..f4ee2bbebaa8c20efaf44879b81cd7cdada81adc 100644 GIT binary patch literal 3638 zcmbVOS#uOs6#hC}CzH+!1W}X_K$6UmiD45$2q6#{m@H%v8&0%8@3>aRuvL^Ps6VC8>d~~GO+|-K zo-&fIf>3hdLTpNb5>rq$ZQ71Iq-P8Tjqyc5!nJ9sTR~-7FPxX^Dc&m6Z9`X}@+0dC zHPs$Bs=EYGX+l9=&Nef;Jr}3xyax(R895_6MTA4Yd^>s9Oh@CUA4Zx z$e8(zg4#Jlx1HhXgkjH`Njg?HYs{F*wBf|E4n5`5mlZ`UMwKbUrtykhX4Z6fD=2Mk z8)LxwttlgfQZ#E=jYp{`Zf1?4eCDKKAJtE$y~tZhJw2w|rubeEmbo(~qt)?1&o3mN z=Ie5F+ZeE|jGsgWds~bAT*z$Oe^VQRg62xJDOeq8?d@sp-Ff^(%Vc|t|J&B?(e-U1 zgt19QWJ&S)7BzGrs-WD-rA=1iMww5?@AXr~6AG5Ilc4{a`h2VB+P*Ewk-5R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JAD@uo_1r01&%zl68^G|`Pho`1%UABijR-c>;{&?CvQg17OG z1l)Zs0Pd55-<5)Ug5dp9@Ox6XdxLJrq~Q0ZmivO12c_T-q?Y@GmXAomAL1iPzzzq& z$E4torEU)f-5!^MFXIy?)Sn2SdVO7-@6n)=NvV?0@VUhObkKcW3jRV0&IZAT6nsSr s&IQ4y6#S($aCY#`87cTHY0BK7rWxO+> zB*Ml_a_7Fzx#!M&e!YJHILCepF^1D{XuJMEcq7-J&bSm(_+GQoY}la;B3DKM5A7R1 zO&Knkl3|ni#+ke63wcuSn GV(%N|aDfK^ delta 120 zcmbQn+Q7_p>ff$?3=9m048jw+8bp~jG{YDfSe)}yQn?tI8F+XYI2br5UQU`^%xLbx z$iN8V0!c2Q4t*fa2&7rHwli>V1TvTyc!4AvSdf{456I?$C}7}c5CHNR83e(qgaFvv B4fp^6 diff --git a/target/classes/sf/codingcompetition2020/structures/Vendor.class b/target/classes/sf/codingcompetition2020/structures/Vendor.class index fdbca9b6e0183e880547b8ff174552c31967ec4f..4ca98d23bab44ce5afcd4090fea916f4fbda8915 100644 GIT binary patch literal 1313 zcmb7D?M~EC5IuLlx|Hg|0xBv9D(qLKxFCLj2%3;=vT7oRMEq5{*R^D6H*J@v@KOAs ziHOm}2k@bcr|kj(YNBb3%XZq9yVsS09oVi@ zpRdmwe&F@2pyx^7*pg1m^%P_ThIY+;)99E^+jzONE3H5vzaM>Wv;;&$AY*#c6eu=N zA~yq%1j_XC`=W`vQ9N-#cSvg|6xOa>H}?;$j8X%I7<%{7+I9 zlq-*McBiYjh6x4NPYD<^X_&+ffvn%{*i^HWMEmx9DJrIMOTkTn;S-@7P9WRT({LLz z98A;`eF9@iSsMeau%sc2TzINzP>>H#H4OvEskj3}!Q3f^r>@(PrlVmVcRA09q3`<( z%XXM?L4%4x4za@6r2aMY&f35+E4CotHSLA-h4YH=yJTnc^b(SD7VE9XVw9FIXq zOEzHpjiWVV5-ys$>GnKJZrI@t4aO96p@@`}MEpB4NQ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ymNAa^Nn$udJ6mv;#)9`b`WFmO`wU|*FtL!h@EjNapjpqN*asYHLW|YW zCPUHgkk^IIu_P{~f5vDcnwZ+a^wVFEOX8+KbK9S394+n!ZIBL?!ch!089Y`uI2&qk zGyS;``Xfzf4f=&$pxp^UJ0FU+unV-iA!t`a(e8($O;O;5YX_2e;5stCfzN)$B7^X5 z!6Ivt3zbBu!;D`SJu06wI From 4ca637ccea6c5ee0ee9d66fe45ed42cb22e7d1cf Mon Sep 17 00:00:00 2001 From: Killian264 Date: Sat, 10 Oct 2020 23:43:09 -0500 Subject: [PATCH 2/2] GUI --- .classpath | 49 +++ .project | 23 ++ .settings/org.eclipse.jdt.apt.core.prefs | 2 + .settings/org.eclipse.jdt.core.prefs | 9 + .settings/org.eclipse.m2e.core.prefs | 4 + .../sf/codingcompetition2020/AgentReport.java | 113 +++++++ .../sf/codingcompetition2020/AreasScreen.java | 187 +++++++++++ .../sf/codingcompetition2020/BarGraph.java | 101 ++++++ .../CodingCompCsvUtil.java | 308 ++++++++++++++---- .../sf/codingcompetition2020/HomeScreen.java | 57 ++++ .../structures/Agent.java | 39 ++- .../structures/Claim.java | 32 +- .../structures/Customer.java | 99 +++++- .../structures/Vendor.java | 33 +- target/classes/META-INF/MANIFEST.MF | 4 +- .../coding-competition/pom.properties | 8 +- .../codingcompetition2020/AgentReport$1.class | Bin 0 -> 1101 bytes .../codingcompetition2020/AgentReport.class | Bin 0 -> 4149 bytes .../codingcompetition2020/AreasScreen$1.class | Bin 0 -> 1322 bytes .../codingcompetition2020/AreasScreen.class | Bin 0 -> 2674 bytes .../sf/codingcompetition2020/Bar.class | Bin 0 -> 464 bytes .../sf/codingcompetition2020/BarGraph.class | Bin 0 -> 2102 bytes .../CodingCompCsvUtil.class | Bin 3251 -> 8237 bytes .../sf/codingcompetition2020/HomeScreen.class | Bin 0 -> 2017 bytes .../structures/Agent.class | Bin 428 -> 1330 bytes .../structures/Claim.class | Bin 397 -> 1292 bytes .../structures/Customer.class | Bin 806 -> 2642 bytes .../structures/Vendor.class | Bin 419 -> 1313 bytes .../CodingCompCsvUtilTest.class | Bin 3972 -> 4647 bytes 29 files changed, 986 insertions(+), 82 deletions(-) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.jdt.apt.core.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 src/main/java/sf/codingcompetition2020/AgentReport.java create mode 100644 src/main/java/sf/codingcompetition2020/AreasScreen.java create mode 100644 src/main/java/sf/codingcompetition2020/BarGraph.java create mode 100644 src/main/java/sf/codingcompetition2020/HomeScreen.java create mode 100644 target/classes/sf/codingcompetition2020/AgentReport$1.class create mode 100644 target/classes/sf/codingcompetition2020/AgentReport.class create mode 100644 target/classes/sf/codingcompetition2020/AreasScreen$1.class create mode 100644 target/classes/sf/codingcompetition2020/AreasScreen.class create mode 100644 target/classes/sf/codingcompetition2020/Bar.class create mode 100644 target/classes/sf/codingcompetition2020/BarGraph.class create mode 100644 target/classes/sf/codingcompetition2020/HomeScreen.class diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..1b799f3 --- /dev/null +++ b/.classpath @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..5edc1ee --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + coding-competition + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.jdt.apt.core.prefs b/.settings/org.eclipse.jdt.apt.core.prefs new file mode 100644 index 0000000..d4313d4 --- /dev/null +++ b/.settings/org.eclipse.jdt.apt.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=false diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..ac8e750 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/src/main/java/sf/codingcompetition2020/AgentReport.java b/src/main/java/sf/codingcompetition2020/AgentReport.java new file mode 100644 index 0000000..3d18bea --- /dev/null +++ b/src/main/java/sf/codingcompetition2020/AgentReport.java @@ -0,0 +1,113 @@ +package sf.codingcompetition2020; + +import java.awt.Color; +import java.awt.Container; +import java.awt.GridLayout; +import java.util.HashMap; +import java.util.List; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JFrame; +import javax.swing.JLabel; + +import sf.codingcompetition2020.structures.Agent; + +public class AgentReport extends JFrame{ + + int width = 2400; + int height = 400; + + + public AgentReport(String area, String agentsFilePath) { + + CodingCompCsvUtil csvUtil = new CodingCompCsvUtil(); + + int total = csvUtil.getAgentCountInArea(agentsFilePath, area); + + this.setLayout(new GridLayout(10, 1)); + + this.setSize(width, height); + + this.setTitle("Area Report for: " + area); + + + + Container pane = this.getContentPane(); + pane.setLayout(new GridLayout(10, 1)); + + int areaCount = csvUtil.getAgentCountInArea(agentsFilePath, area); + + JLabel agentHeaderLabel = new JLabel("Number of agents in area : " + Integer.toString(areaCount)); + pane.add(agentHeaderLabel); + + + // language to agents speaking it in area + HashMap> languageToAgents = new HashMap>(); + + List languages = csvUtil.getAllAgentLanguagesInArea(agentsFilePath, area); + + for(String language : languages) { + csvUtil.getAgentsInAreaThatSpeakLanguage(agentsFilePath, area, language); + List agentsSpeakignLanugage = csvUtil.getAgentsInAreaThatSpeakLanguage(agentsFilePath, area, language); + languageToAgents.put(language, agentsSpeakignLanugage); + } + + JLabel languageTableLabel = new JLabel("Language : Amount Spoken in Area : COLOR"); + pane.add(languageTableLabel); + + // This is an abomination I apologize in advance, haha + + Color[] colors = new Color[] {Color.RED, Color.GREEN, Color.gray, Color.CYAN, Color.black, Color.BLUE, Color.PINK, Color.MAGENTA, Color.YELLOW}; + HashMap colorToString = new HashMap(){{ + put(Color.RED, "RED"); + put(Color.GREEN, "GREEN"); + put(Color.gray, "GRAY"); + put(Color.CYAN, "CYAN"); + put(Color.black, "BLACK"); + put(Color.BLUE, "BLUE"); + put(Color.PINK, "PINK"); + put(Color.MAGENTA, "MAGENTA"); + put(Color.YELLOW, "YELLOW"); + }}; + + int currentColor = 0; + int maxColor = 0; + + for(String language : languageToAgents.keySet()) { + int amountSpoken = languageToAgents.get(language).size(); + JLabel languageLabel = new JLabel( language + " : " + Integer.toString(amountSpoken) + " : " + colorToString.get(colors[currentColor])); + pane.add(languageLabel); + + currentColor++; + if(currentColor == colors.length) { + currentColor = 0; + } + } + + + + BarGraph graph = new BarGraph(55, 55); + + this.getContentPane().add(graph); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + this.pack(); + + currentColor = 0; + maxColor = 0; + + for(String language : languageToAgents.keySet()) { + + int amountSpoken = languageToAgents.get(language).size(); + graph.addBar(colors[currentColor], amountSpoken); + currentColor++; + if(currentColor == colors.length) { + currentColor = 0; + } + } + + + + } + +} diff --git a/src/main/java/sf/codingcompetition2020/AreasScreen.java b/src/main/java/sf/codingcompetition2020/AreasScreen.java new file mode 100644 index 0000000..e3db005 --- /dev/null +++ b/src/main/java/sf/codingcompetition2020/AreasScreen.java @@ -0,0 +1,187 @@ +package sf.codingcompetition2020; + +import javax.swing.JFrame; +import java.awt.Container; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.Label; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; + +import codingcompetition2019.AllNaturalDisasters; + +public class AreasScreen extends JFrame{ + + private final String agentFilePath = "src/main/resources/DataFiles/agents.csv"; + private final String claimFilePath = "src/main/resources/DataFiles/claims.csv"; + private final String customerFilePath = "src/main/resources/DataFiles/customers.csv"; + private final String vendorFilePath = "src/main/resources/DataFiles/vendors.csv"; + + private CodingCompCsvUtil csvUtil; + private JComboBox areaComboBox; + private ArrayList areas; + + public AreasScreen() { + csvUtil = new CodingCompCsvUtil(); + + this.setTitle("AgentReport"); + + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + this.setLocationRelativeTo(null); + + this.setSize(400, 100); + + csvUtil = new CodingCompCsvUtil(); + + + JLabel areaLabel = new JLabel("View data in area: "); + areaLabel.setVerticalAlignment(JLabel.TOP); + this.add(areaLabel); + + areas = (ArrayList) csvUtil.getAllAgentAreas(agentFilePath); + + areas.add(0, "Choose an area."); + + this.areaComboBox = new JComboBox(areas.toArray()); + this.setLayout(new FlowLayout()); + this.add(this.areaComboBox); + + JButton viewDataButton = new JButton("View Data"); + this.getContentPane().add(viewDataButton); // Adds Button to content pane of frame + + + this.setVisible(true); + + viewDataButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + if(areaComboBox.getSelectedIndex() == 0) { + return; + } + String area = areas.get(areaComboBox.getSelectedIndex() - 1); + new AgentReport(area, agentFilePath).setVisible(true); + + } + }); + } +} + + + +//package sf.codingcompetition2020; +// +//import java.awt.Container; +//import java.awt.FlowLayout; +//import java.awt.GridLayout; +//import java.awt.Label; +//import java.awt.event.ActionEvent; +//import java.awt.event.ActionListener; +//import java.util.ArrayList; +//import java.util.Arrays; +//import java.util.List; +//import java.util.stream.Stream; +// +//import javax.swing.Box; +//import javax.swing.JButton; +//import javax.swing.JComboBox; +//import javax.swing.JFrame; +//import javax.swing.JLabel; +// +//import codingcompetition2019.AllNaturalDisasters; +//import sf.codingcompetition2020.structures.Agent; +// +//public class HomeScreen { +// +// private static final String agentFilePath = "src/main/resources/DataFiles/agents.csv"; +// private static final String claimFilePath = "src/main/resources/DataFiles/claims.csv"; +// private static final String customerFilePath = "src/main/resources/DataFiles/customers.csv"; +// private static final String vendorFilePath = "src/main/resources/DataFiles/vendors.csv"; +// +// public static void main(String args[]) { +// JFrame frame = new JFrame("Agent Report"); +// frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); +// frame.setLocationRelativeTo(null); +// +// frame.setSize(400, 100); +// +//// JLabel headerLabel = new JLabel("Choose an Agent to view a report:"); +//// headerLabel.setVerticalAlignment(JLabel.TOP); +//// frame.add(headerLabel); +//// +// CodingCompCsvUtil csvUtil = new CodingCompCsvUtil(); +//// +//// ArrayList agents = (ArrayList) csvUtil.readCsvFile(agentFilePath, Agent.class); +//// +//// +//// ArrayList agentNames = new ArrayList(); +//// +//// agentNames.add("Ghoose an Agent:"); +//// +// +//// for(Agent agent : agents) { +//// agentNames.add(agent.getFirstName() + " " + agent.getLastName()); +//// } +// +// JLabel areaLabel = new JLabel("View data in area: "); +// areaLabel.setVerticalAlignment(JLabel.TOP); +// frame.add(areaLabel); +// +// ArrayList areas = new ArrayList(); +// +//// ArrayList areas = (ArrayList) csvUtil.getAllAreas(agentFilePath); +// +// areas.add(0, "Choose an area."); +// +// JComboBox areaComboBox = new JComboBox(areas.toArray()); +// frame.setLayout(new FlowLayout()); +// frame.add(areaComboBox); +// +// JButton button = new JButton("View Data"); +// frame.getContentPane().add(button); // Adds Button to content pane of frame +// +// +// frame.setVisible(true); +// +// btnGetData.addActionListener(new ActionListener() { +// public void buttonClick(ActionEvent e) { +// String area = areas.get(areaComboBox.getSelectedIndex() - 1); +// JFrame agentAreaFrame = this.ViewAgentsByArea(csvUtil, area); +// agentAreaFrame.setVisible(true); +// +// } +// }); +// +// +// } +// +// +// +// public static JFrame ViewAgentsByArea(CodingCompCsvUtil csvUtil, String area) { +// +// JFrame frame = new JFrame(); +// +// int total = csvUtil.getAgentCountInArea(agentFilePath ,area); +// +// Container pane = frame.getContentPane(); +// pane.setLayout(new GridLayout(2, 2)); +// pane.add(Box.createVerticalGlue()); +// +// JLabel headerLabel = new JLabel("Number of agents in area:"); +// headerLabel.setVerticalAlignment(JLabel.TOP); +// frame.add(headerLabel); +// +// return frame; +// +// +// } +// +//} diff --git a/src/main/java/sf/codingcompetition2020/BarGraph.java b/src/main/java/sf/codingcompetition2020/BarGraph.java new file mode 100644 index 0000000..2637a8e --- /dev/null +++ b/src/main/java/sf/codingcompetition2020/BarGraph.java @@ -0,0 +1,101 @@ +package sf.codingcompetition2020; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.util.ArrayList; + +import javax.swing.JPanel; + +public class BarGraph extends JPanel { + private ArrayList bars = new ArrayList(); +// private ArrayList keys = new ArrayList(); + + private int width; + private int height; + + private int chartWidth; + private int chartHeight; + + public BarGraph(int width, int height) { + this.height = height; + this.width = width; + +// this.chartHeight = (int) (height * .7); +// this.chartWidth = (int) (width * .7); +// +// JPanel dataTypePanel = new JPanel(); +// dataTypePanel.setLayout(new GridLayout(1, 2)); +// dataTypePanel.setBorder(new EmptyBorder(20, 20, 20, 20)); +// dataTypePanel.add(new JLabel("Select Data Type")); + } + +// public BarGraph(int width, int height, int chartWidth, int chartHeight) { +// this.height = height; +// this.width = width; +// +// this.chartWidth = chartWidth; +// this.chartHeight = chartHeight; +// } + + public void addBar(Color color, int size) { + Bar bar = new Bar(color, size); + this.bars.add(bar); + repaint(); + } + +// public void addKey(Color color, String description) { +// Key key = new Key(color, description); +// this.keys.add(key); +// repaint(); +// } + + @Override + protected void paintComponent(Graphics g) { + int max = Integer.MIN_VALUE; + for (Bar bar : bars) { + if (bar.size > max) { + max = bar.size; + } + } + + // Draw the actual bars + int width = (getWidth() / bars.size()) - 2; + int x = 1; + for (Bar bar : bars) { + Color color = bar.color; + int height = (int) ((getHeight() - 5) * ((double) bar.size / max)); + g.setColor(color); + g.fillRect(x, getHeight() - height, width, height); + g.setColor(Color.black); + g.drawRect(x, getHeight() - height, width, height); + x += (width + 2); + } + + } + + @Override + public Dimension getPreferredSize() { + return new Dimension(this.height, this.width); + } +} + +class Bar { + public Color color; + public Integer size; + + public Bar(Color color, Integer size) { + this.color = color; + this.size = size; + } +} + +//class Key { +// public Color color; +// public String description; +// +// public Key(Color color, String description) { +// this.color = color; +// this.description = description; +// } +//} \ No newline at end of file diff --git a/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java b/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java index 58267da..a2ce76f 100644 --- a/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java +++ b/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java @@ -1,20 +1,15 @@ package sf.codingcompetition2020; -import java.io.FileReader; -import java.io.Reader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InvalidClassException; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.MappingIterator; -import com.fasterxml.jackson.databind.ObjectReader; -import com.fasterxml.jackson.dataformat.csv.CsvMapper; -import com.fasterxml.jackson.dataformat.csv.CsvSchema; +import java.util.Scanner; import sf.codingcompetition2020.structures.Agent; import sf.codingcompetition2020.structures.Claim; @@ -22,126 +17,301 @@ import sf.codingcompetition2020.structures.Vendor; public class CodingCompCsvUtil { - - /* #1 - * readCsvFile() -- Read in a CSV File and return a list of entries in that file. + + /* + * #1 readCsvFile() -- Read in a CSV File and return a list of entries in that + * file. + * * @param filePath -- Path to file being read in. + * * @param classType -- Class of entries being read in. + * * @return -- List of entries being returned. */ public List readCsvFile(String filePath, Class classType) { + Class myClass = classType.getClass(); + List list = new ArrayList(); + + File in = new File(filePath); + Scanner readMe = new Scanner(System.in); + try { + readMe = new Scanner(in); + String line = ""; + if (readMe.hasNextLine()) { + line = readMe.nextLine(); + } + while (readMe.hasNextLine()) { + line = readMe.nextLine(); + + if (classType.equals(Agent.class)) { + list.add((T) Agent.parseFromString(line)); + } else if (classType.equals(Claim.class)) { + list.add((T) Claim.parseFromString(line)); + } else if (classType.equals(Customer.class)) { + list.add((T) Customer.parseFromString(line)); + } else if (classType.equals(Vendor.class)) { + list.add((T) Vendor.parseFromString(line)); + } else { + throw new InvalidClassException("Cannot convert to class: " + classType.toString()); + } + } + } catch (FileNotFoundException e) { + System.out.println("No file found at " + filePath); + } catch (IOException e) { + System.out.println(e.getMessage()); + } + readMe.close(); + return list; } - - /* #2 - * getAgentCountInArea() -- Return the number of agents in a given area. + private List getStructInArea(String filePath, String area, Class classType) throws InvalidClassException { + List list = readCsvFile(filePath, classType); + List listarea = new ArrayList(); + String s = ""; + for (T struct : list) { + if (classType.equals(Agent.class)) { + s = ((Agent) struct).getArea(); + } else if (classType.equals(Claim.class)) { + throw new InvalidClassException("Cannot get on area of class" + classType.toString()); + } else if (classType.equals(Customer.class)) { + s = ((Customer) struct).getArea(); + } else if (classType.equals(Vendor.class)) { + s = ((Vendor) struct).getArea(); + } + if (s.equals(area)) { + listarea.add(struct); + } + } + return listarea; + } + + /* + * #2 getAgentCountInArea() -- Return the number of agents in a given area. + * * @param filePath -- Path to file being read in. + * * @param area -- The area from which the agents should be counted. + * * @return -- The number of agents in a given area */ - public int getAgentCountInArea(String filePath,String area) { - + public int getAgentCountInArea(String filePath, String area) { + int result = 0; + try { + result = (int) getStructInArea(filePath, area, Agent.class).size(); + } catch (InvalidClassException e) { + System.out.println("Should Not Happen: " + e.getMessage()); + throw new RuntimeException(e.getMessage()); + } + return result; } + /* + * #3 getAllAgentLanguages() -- Return a list of areas + * area, that speak a certain language. + * + * @param filePath -- Path to file being read in. + * + * @return -- Unique areas + */ + public List getAllAgentAreas(String agentFilePath) { + List agents = readCsvFile(agentFilePath, Agent.class); + + // Boolean will go unused + HashMap areaMap = new HashMap(); + + for(Agent agent : agents) { + areaMap.put(agent.getArea(), true); + } + + ArrayList areas = new ArrayList(); + + for(String key : areaMap.keySet()) { + areas.add(key); + } + + return areas; + } - /* #3 - * getAgentsInAreaThatSpeakLanguage() -- Return a list of agents from a given area, that speak a certain language. + /* + * #3 getAllAgentLanguages() -- Return a list of languages spoken + * area, that speak a certain language. + * * @param filePath -- Path to file being read in. + * + * @param area -- The area from which the agents languages should be added. + * + * @return -- The languages spoken in the area + */ + public List getAllAgentLanguagesInArea(String agentFilePath, String area) { + List agents = readCsvFile(agentFilePath, Agent.class); + + // Boolean will go unused + HashMap areaMap = new HashMap(); + + for(Agent agent : agents) { + if(!agent.getArea().equals(area)) { + continue; + } + areaMap.put(agent.getLanguage(), true); + } + + ArrayList areas = new ArrayList(); + + for(String key : areaMap.keySet()) { + areas.add(key); + } + + return areas; + } + + /* + * #3 getAgentsInAreaThatSpeakLanguage() -- Return a list of agents from a given + * area, that speak a certain language. + * + * @param filePath -- Path to file being read in. + * * @param area -- The area from which the agents should be counted. + * * @param language -- The language spoken by the agent(s). + * * @return -- The number of agents in a given area */ public List getAgentsInAreaThatSpeakLanguage(String filePath, String area, String language) { - + List agents = new ArrayList(); + try { + agents = getStructInArea(filePath, area, Agent.class); + } catch (Exception e) { + System.out.println("Should Not Happen: " + e.getMessage()); + } + List result = new ArrayList(); + for (Agent agent : agents) { + if (agent.getLanguage().equals(language)) { + result.add(agent); + } + } + return result; } - - - /* #4 - * countCustomersFromAreaThatUseAgent() -- Return the number of individuals from an area that use a certain agent. + + /* + * #4 countCustomersFromAreaThatUseAgent() -- Return the number of individuals + * from an area that use a certain agent. + * * @param filePath -- Path to file being read in. + * * @param customerArea -- The area from which the customers should be counted. + * * @param agentFirstName -- First name of agent. + * * @param agentLastName -- Last name of agent. + * * @return -- The number of customers that use a certain agent in a given area. */ - public short countCustomersFromAreaThatUseAgent(Map csvFilePaths, String customerArea, String agentFirstName, String agentLastName) { - + public short countCustomersFromAreaThatUseAgent(Map csvFilePaths, String customerArea, + String agentFirstName, String agentLastName) { + return 0; } - - /* #5 - * getCustomersRetainedForYearsByPlcyCostAsc() -- Return a list of customers retained for a given number of years, in ascending order of their policy cost. + /* + * #5 getCustomersRetainedForYearsByPlcyCostAsc() -- Return a list of customers + * retained for a given number of years, in ascending order of their policy + * cost. + * * @param filePath -- Path to file being read in. + * * @param yearsOfServeice -- Number of years the person has been a customer. - * @return -- List of customers retained for a given number of years, in ascending order of policy cost. + * + * @return -- List of customers retained for a given number of years, in + * ascending order of policy cost. */ public List getCustomersRetainedForYearsByPlcyCostAsc(String customerFilePath, short yearsOfService) { - + return null; } - - /* #6 - * getLeadsForInsurance() -- Return a list of individuals who’ve made an inquiry for a policy but have not signed up. - * *HINT* -- Look for customers that currently have no policies with the insurance company. + /* + * #6 getLeadsForInsurance() -- Return a list of individuals who’ve made an + * inquiry for a policy but have not signed up. *HINT* -- Look for customers + * that currently have no policies with the insurance company. + * * @param filePath -- Path to file being read in. - * @return -- List of customers who’ve made an inquiry for a policy but have not signed up. + * + * @return -- List of customers who’ve made an inquiry for a policy but have + * not signed up. */ public List getLeadsForInsurance(String filePath) { - + return null; } - - /* #7 - * getVendorsWithGivenRatingThatAreInScope() -- Return a list of vendors within an area and include options to narrow it down by: - a. Vendor rating - b. Whether that vendor is in scope of the insurance (if inScope == false, return all vendors in OR out of scope, if inScope == true, return ONLY vendors in scope) + /* + * #7 getVendorsWithGivenRatingThatAreInScope() -- Return a list of vendors + * within an area and include options to narrow it down by: a. Vendor rating b. + * Whether that vendor is in scope of the insurance (if inScope == false, return + * all vendors in OR out of scope, if inScope == true, return ONLY vendors in + * scope) + * * @param filePath -- Path to file being read in. + * * @param area -- Area of the vendor. + * * @param inScope -- Whether or not the vendor is in scope of the insurance. + * * @param vendorRating -- The rating of the vendor. - * @return -- List of vendors within a given area, filtered by scope and vendor rating. + * + * @return -- List of vendors within a given area, filtered by scope and vendor + * rating. */ - public List getVendorsWithGivenRatingThatAreInScope(String filePath, String area, boolean inScope, int vendorRating) { - + public List getVendorsWithGivenRatingThatAreInScope(String filePath, String area, boolean inScope, + int vendorRating) { + return null; } - - /* #8 - * getUndisclosedDrivers() -- Return a list of customers between the age of 40 and 50 years (inclusive), who have: - a. More than X cars - b. less than or equal to X number of dependents. + /* + * #8 getUndisclosedDrivers() -- Return a list of customers between the age of + * 40 and 50 years (inclusive), who have: a. More than X cars b. less than or + * equal to X number of dependents. + * * @param filePath -- Path to file being read in. + * * @param vehiclesInsured -- The number of vehicles insured. + * * @param dependents -- The number of dependents on the insurance policy. - * @return -- List of customers filtered by age, number of vehicles insured and the number of dependents. + * + * @return -- List of customers filtered by age, number of vehicles insured and + * the number of dependents. */ public List getUndisclosedDrivers(String filePath, int vehiclesInsured, int dependents) { + return null; + } - } - - - /* #9 - * getAgentIdGivenRank() -- Return the agent with the given rank based on average customer satisfaction rating. - * *HINT* -- Rating is calculated by taking all the agent rating by customers (1-5 scale) and dividing by the total number - * of reviews for the agent. + /* + * #9 getAgentIdGivenRank() -- Return the agent with the given rank based on + * average customer satisfaction rating. *HINT* -- Rating is calculated by + * taking all the agent rating by customers (1-5 scale) and dividing by the + * total number of reviews for the agent. + * * @param filePath -- Path to file being read in. + * * @param agentRank -- The rank of the agent being requested. + * * @return -- Agent ID of agent with the given rank. */ public int getAgentIdGivenRank(String filePath, int agentRank) { - - } + return 0; + } - - /* #10 - * getCustomersWithClaims() -- Return a list of customers who’ve filed a claim within the last (inclusive). + /* + * #10 getCustomersWithClaims() -- Return a list of customers who’ve filed a + * claim within the last (inclusive). + * * @param filePath -- Path to file being read in. + * * @param monthsOpen -- Number of months a policy has been open. - * @return -- List of customers who’ve filed a claim within the last . + * + * @return -- List of customers who’ve filed a claim within the last + * . */ - public List getCustomersWithClaims(Map csvFilePaths, short monthsOpen) { - - } + public List getCustomersWithClaims(Map csvFilePaths, short monthsOpen) { + return null; + } } diff --git a/src/main/java/sf/codingcompetition2020/HomeScreen.java b/src/main/java/sf/codingcompetition2020/HomeScreen.java new file mode 100644 index 0000000..bb73b27 --- /dev/null +++ b/src/main/java/sf/codingcompetition2020/HomeScreen.java @@ -0,0 +1,57 @@ +package sf.codingcompetition2020; + +import java.awt.Container; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.Label; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; + +import codingcompetition2019.AllNaturalDisasters; +import sf.codingcompetition2020.structures.Agent; + +public class HomeScreen { + + private static final String agentFilePath = "src/main/resources/DataFiles/agents.csv"; + private static final String claimFilePath = "src/main/resources/DataFiles/claims.csv"; + private static final String customerFilePath = "src/main/resources/DataFiles/customers.csv"; + private static final String vendorFilePath = "src/main/resources/DataFiles/vendors.csv"; + + public static void main(String args[]) { + AreasScreen screen = new AreasScreen(); + screen.setVisible(true); + + } + + + + public static JFrame ViewAgentsByArea(CodingCompCsvUtil csvUtil, String area) { + + JFrame frame = new JFrame(); + + int total = csvUtil.getAgentCountInArea(agentFilePath ,area); + + Container pane = frame.getContentPane(); + pane.setLayout(new GridLayout(2, 2)); + pane.add(Box.createVerticalGlue()); + + JLabel headerLabel = new JLabel("Number of agents in area:"); + headerLabel.setVerticalAlignment(JLabel.TOP); + frame.add(headerLabel); + + return frame; + + + } + +} diff --git a/src/main/java/sf/codingcompetition2020/structures/Agent.java b/src/main/java/sf/codingcompetition2020/structures/Agent.java index e2e6f93..d4987c5 100644 --- a/src/main/java/sf/codingcompetition2020/structures/Agent.java +++ b/src/main/java/sf/codingcompetition2020/structures/Agent.java @@ -1,11 +1,46 @@ package sf.codingcompetition2020.structures; public class Agent { - + private int agentId; private String area; private String language; private String firstName; private String lastName; - + + private Agent() { + // blank + } + + public static Agent parseFromString(String line) { + Agent agent = new Agent(); + String[] arr = line.split(","); + agent.agentId = Integer.parseInt(arr[0]); + agent.area = arr[1]; + agent.language = arr[2]; + agent.firstName = arr[3]; + agent.lastName = arr[4]; + + return agent; + } + + public int getAgentId() { + return agentId; + } + + public String getArea() { + return area; + } + + public String getLanguage() { + return language; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } } diff --git a/src/main/java/sf/codingcompetition2020/structures/Claim.java b/src/main/java/sf/codingcompetition2020/structures/Claim.java index 581140a..5631ac2 100644 --- a/src/main/java/sf/codingcompetition2020/structures/Claim.java +++ b/src/main/java/sf/codingcompetition2020/structures/Claim.java @@ -5,5 +5,35 @@ public class Claim { private int customerId; private boolean closed; private int monthsOpen; - + + private Claim() { + // blank + } + + public static Claim parseFromString(String line) { + Claim claim = new Claim(); + String[] arr = line.split(","); + claim.claimId = Integer.parseInt(arr[0]); + claim.customerId = Integer.parseInt(arr[1]); + claim.closed = Boolean.parseBoolean(arr[2]); + claim.monthsOpen = Integer.parseInt(arr[3]); + + return claim; + } + + public int getClaimId() { + return claimId; + } + + public int getCustomerId() { + return customerId; + } + + public boolean isClosed() { + return closed; + } + + public int getMonthsOpen() { + return monthsOpen; + } } diff --git a/src/main/java/sf/codingcompetition2020/structures/Customer.java b/src/main/java/sf/codingcompetition2020/structures/Customer.java index f151906..dc181a5 100644 --- a/src/main/java/sf/codingcompetition2020/structures/Customer.java +++ b/src/main/java/sf/codingcompetition2020/structures/Customer.java @@ -3,9 +3,8 @@ import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; public class Customer { private int customerId; @@ -24,4 +23,98 @@ public class Customer { private short yearsOfService; private Integer vehiclesInsured; + private Customer() { + // blank + } + + public static Customer parseFromString(String line) { + Customer customer = new Customer(); + // https://stackoverflow.com/questions/18893390/splitting-on-comma-outside-quotes + // for regex + String[] arr = line.split(",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)"); + Gson son = new Gson(); + customer.customerId = Integer.parseInt(arr[0]); + customer.firstName = arr[1]; + customer.lastName = arr[2]; + customer.age = Integer.parseInt(arr[3]); + customer.area = arr[4]; + customer.agentId = Integer.parseInt(arr[5]); + customer.agentRating = Short.parseShort(arr[6]); + customer.primaryLanguage = arr[7]; + customer.dependents = new ArrayList(); + try { + customer.dependents = son.fromJson(arr[8], ArrayList.class); + } catch (JsonSyntaxException e) { + System.out.print(arr[8]); + } + customer.homePolicy = Boolean.parseBoolean(arr[9]); + customer.autoPolicy = Boolean.parseBoolean(arr[10]); + customer.rentersPolicy = Boolean.parseBoolean(arr[11]); + customer.totalMonthlyPremium = arr[12]; + customer.yearsOfService = Short.parseShort(arr[13]); + customer.vehiclesInsured = Integer.parseInt(arr[14]); + + return customer; + } + + public int getCustomerId() { + return customerId; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public int getAge() { + return age; + } + + public String getArea() { + return area; + } + + public int getAgentId() { + return agentId; + } + + public short getAgentRating() { + return agentRating; + } + + public String getPrimaryLanguage() { + return primaryLanguage; + } + + public List getDependents() { + return dependents; + } + + public boolean isHomePolicy() { + return homePolicy; + } + + public boolean isAutoPolicy() { + return autoPolicy; + } + + public boolean isRentersPolicy() { + return rentersPolicy; + } + + public String getTotalMonthlyPremium() { + return totalMonthlyPremium; + } + + public short getYearsOfService() { + return yearsOfService; + } + + public Integer getVehiclesInsured() { + return vehiclesInsured; + } + } diff --git a/src/main/java/sf/codingcompetition2020/structures/Vendor.java b/src/main/java/sf/codingcompetition2020/structures/Vendor.java index 6b6fb76..aed96a9 100644 --- a/src/main/java/sf/codingcompetition2020/structures/Vendor.java +++ b/src/main/java/sf/codingcompetition2020/structures/Vendor.java @@ -5,5 +5,36 @@ public class Vendor { private String area; private int vendorRating; private boolean inScope; - + + private Vendor() { + // blank + } + + public static Vendor parseFromString(String line) { + Vendor vendor = new Vendor(); + String[] arr = line.split(","); + vendor.vendorId = Integer.parseInt(arr[0]); + vendor.area = arr[1]; + vendor.vendorRating = Integer.parseInt(arr[2]); + vendor.inScope = Boolean.parseBoolean(arr[3]); + + return vendor; + } + + public int getVendorId() { + return vendorId; + } + + public String getArea() { + return area; + } + + public int getVendorRating() { + return vendorRating; + } + + public boolean isInScope() { + return inScope; + } + } diff --git a/target/classes/META-INF/MANIFEST.MF b/target/classes/META-INF/MANIFEST.MF index e2a1a34..8952561 100644 --- a/target/classes/META-INF/MANIFEST.MF +++ b/target/classes/META-INF/MANIFEST.MF @@ -1,5 +1,5 @@ Manifest-Version: 1.0 -Built-By: yc1d -Build-Jdk: 1.8.0_201 +Built-By: Killian +Build-Jdk: 14.0.2 Created-By: Maven Integration for Eclipse diff --git a/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties b/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties index fe569e3..f09e580 100644 --- a/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties +++ b/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties @@ -1,7 +1,7 @@ #Generated by Maven Integration for Eclipse -#Thu Oct 08 09:27:33 MST 2020 -version=1.0.0-SNAPSHOT -groupId=sf.codingcompetition2020 +#Sat Oct 10 20:08:20 CDT 2020 +m2e.projectLocation=C\:\\Users\\Killian\\Desktop\\2020 m2e.projectName=coding-competition -m2e.projectLocation=/Users/yc1d/Development/coding-competition/problem/online-competition +groupId=sf.codingcompetition2020 artifactId=coding-competition +version=1.0.0-SNAPSHOT diff --git a/target/classes/sf/codingcompetition2020/AgentReport$1.class b/target/classes/sf/codingcompetition2020/AgentReport$1.class new file mode 100644 index 0000000000000000000000000000000000000000..97e9844bfdeac50a8eb61f7495f2214ce45ea9e8 GIT binary patch literal 1101 zcma)5TT|0O7(EMxre%c^ybE3nv_+e?Dj-ELEukQxI0a$)n5MA=L()l79e2r-N%dzF@x)r)6ljU zQu_bFvV@r=^}NM#8+RzH+Y1?1GnZ+O;dYdR)|q97<*Q8gDkU~?k7HIWI96+DT3y1d zARll%6lAR98($PM=CWkJ86A5b!Q@ZV1 z_1<~Q@{f#`V=>6OXBy72;oD*!kujk(!*HUdi==e&(Chi8wQY-@sR2Lbg$@jfL%ZV| zVb7=V%H{tYG}rni^-s$|6%Iq6EL+~7Ri-r8bi9D3`&M}Bwd2@kNDpI1VW1s`#X-TN z#slg`jBp{}bzRG^Iz|v!0clE>p`*l7Dd94k*eZ!P| z;{rEN2;G(EB6MGV6rm^bLWCCOT!fy=N`wmX^9a3=S0c13mj(Jt>x^KX-g!*WdxLhc zN#1{hIjC4fg${fbWo$vC`vBW$q6U-lUQ;&j@4QX3O`651N_11HN{m&i60AlQyM)A% I5noEzU(aOy0RR91 literal 0 HcmV?d00001 diff --git a/target/classes/sf/codingcompetition2020/AgentReport.class b/target/classes/sf/codingcompetition2020/AgentReport.class new file mode 100644 index 0000000000000000000000000000000000000000..b68b88c8ee2d3080c43f667b0b1392f77e26b927 GIT binary patch literal 4149 zcma)9Yj{&<9sj*)nxyGlng+@UgDo%^ZGaUR6igY|W`%}@wvy5swh5={X?tjzlO-oy z=3VCvht7E)>ZYhw=WQLNusYo4ebYHFQ@niI7kwU`&*KL_dilNQByFMXBlO|qR_j3GGx%;Usxm4(!WoR9xx`IaA+U5rx9rejW-)8Uv+a3ZyJ1h`UaX`FJ1Fg>)v`Zt3?;PFX3_E^ zgjLG-)dZy}9&hgV)8|_y!dN3vQ_wAkPvGVog|J?}#k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xfLDHquaY z>>`##8pITGNp|RB+nMNoT@VlpQa|yRZA{WSc0f7?M@??D~xM2#- zVmU$y(8aXAG3HeHR^fEq0Cj%46g#t59*3+Z<5Y;dr!zl3C{wy|!TEp>Djpdh^uD(@ev6ODDD+AB}ML-Wd*9q7Z; zm`DY726j&2>(P3Z2W7cyAmSGGAR20z@ijnSnbuifgQ0rclSZ0->N=|w zv#q}H6l<#r7x{bvTlicKH@CA|R#y-!u#$gkv5F_Ra0w2hm%m;5`MW^J28^Q_XAr@o z{FQNz9Ot=6PvcJf5Zm!GcHk<%zlL3SoxcG7#f^Rk_K3YWAUe25cXBH}hHmiydc>3H z6;E>oF0o3kpiex{vzKs0T*ZCjHQX=$!X@)>+#~-1P5cvSmxS(GjbT?aMqHaP>e>#& zwUhLA?jHske^t{~N#L+Y+Ln*;?v}MK4|m?ESLvM#e^7wnkN6Wm)kbla HpZxbf3*l&D literal 0 HcmV?d00001 diff --git a/target/classes/sf/codingcompetition2020/AreasScreen$1.class b/target/classes/sf/codingcompetition2020/AreasScreen$1.class new file mode 100644 index 0000000000000000000000000000000000000000..e8cb5e4418f67952d3ff97a3f002133c27e2aeab GIT binary patch literal 1322 zcmb7E?M@Rx6g@*%7S_d9Q2YWxt*|Y~QbbV8hfu)O6gAc~(SOtJP?l_W$owSEi>4s?-Tqo=z;dz8ftuWUS7PWGW0=A*hL7F!Y(w(PJQiq={an7!sCB zNS0h*yxeP4MfjFiJ;Bgl3LNfLc<8EqE2t^D44omTb3`}E{mHsKp zx)La#sTjD9n>ubVq&tzs#4QXl^l--!GL~|=GkW<<%;V6O2h?EuMImTZgVo?LZ{RjY zb&N1vRYdZ6Nj;uMMXbt;y%VsN#z(8|BIBp7r7ppEaV@Q zSBR2@td0!BK&;)_pG{0)lF*3|akh%h!rHx<*D-a*qU9*0qIHn-&QZBe9eE>mgD~pB z48yn#9lOC@-wuTg_CgZeUgHtpa6MXal`W?nxo^P6tg_c5I@9WQJQz*Xe6#=U5!H1Y z^ClkS34B83tQ7e1t|Az<7PV-Cd_ezXbEf+sLMMV<&)NMZqt bR6+tvbh-=6ct+nEIXX$ysW8e?Wzgpj`P5Sr literal 0 HcmV?d00001 diff --git a/target/classes/sf/codingcompetition2020/AreasScreen.class b/target/classes/sf/codingcompetition2020/AreasScreen.class new file mode 100644 index 0000000000000000000000000000000000000000..053d9ab4686edaf6dc1f3ebe10d5397eaba52b7d GIT binary patch literal 2674 zcmb7G*;gA?9R4m_LOP|8?u(MPv<(9#l&Y@O;U+$TLs@W?qHAN0jP%Hwxu0Fwf>l5=M6o%>tA@Avy%{`&jZ-vAuJw-M9{ba*#X z1*d4*Qw66qWB8_TI(A=gUvDby8qympxQ1az&>#@MDQD&Fls8A&)VU#7mJET7a>}s% zA=5HOq(4oetddGuk}_kyOVNG`WgOe{rS0dWRW_n%7C7X&g;YtJcFHw8r|cFCFEuEA zsVsS^z^K<#@Mfu8u%ua9_7H{kU&?{}l5%UI?D~P z;sVJ>8VD7Z)FVt{!Z$5}?(DiyX95B;Bp?$?6EsZ{e}2k4XPw&u+XG-%;9owVV51WB z1h$6Im+6e$x$;id^n9K-kC{`p^vf>k>Rd}^U^Qo_sMj=L+NOU>pg!4|6KG(NMhx|6 z*RUIVnjx@PLnE5hYQKh9xH_O=W4Jn`p%qOLbSl8tE3#FY$B;z3GTE(RGqyz0Bd{T@ zifq)Faa=#fqh5{W+b0n941e78Ehe@#xjKo?oDzOY!_#<1U43_o>y8hUZoITWB_C zxV~ACR@x$?CAwDm4Qn`u^JGaDi$r?u2t#mc!&XRN&~Oo#1X`yIKW$k7&OzUEFsy}W zRrv(f6~T*4B53*Ax>F2}Y1ob(QA`MI%1k@NJR!p*dtw;DWfk~K0^5?qRoq?5-!uve z(+IARh?<$RT=Yu&Weu<3Rl@B%L9we6=)AhxPz;l}uF#aq(;5PuITdR`!&YpIfV73_ zD6EDoXD%!6IAsD|M7u(JT7!w3Y${bD!I8l3D$K)g7o^P*<_1}?^8<@3t$ViY`;Hw2 z3$Hn#U(LN3ZedV4cuj)~c5@3E;n?)a@`$t<*0$tQ^M)+iK8Gh=#8Ad?1RRvXd`{Jz zDucH*+`(Oem?|LCGxMrl8j@EO!mkS)T(>oYItb@~$B`KB;Y|hOTO1oZ+Y4W}x{VC(|>s*p1{HvLqs1WmAZvP|@1xs*5DaT!D(SG{TFq-(1E z(#HmW+9YlVA1^jyuevShL^fAYH!BPUUpWC=X4##Joscq?Sgl<6nSxPS;05M&^a`AQ zTySblEthtcu_FQ}|Cg~;Z41&=Y%I81)#b+?ui~ah^%d`!VVgW;Ea`cMhrO(pdj4w= zL0rvs?jqdPA<8|c`^tU;_nh%7`xfpw=~wn`)Zyq3blFtFn}dMoJA?HudSTaK51&r} z;u;zPzklircv6o?=aJCk8|JZ3kGIUDLyx!3|=5}3EwV4w3}e;;cq_<;Q$Wv*~b}t3_8xB8|RV21bT6Wm)mt5#SHJQyFC3I z$MGHSrSH*?2N=LlycK>y8h=pZ1A0h=;Ne4j#N7n-KE@}6_5uBUiqBBj8l{adLa^yq y@CP)iq<-L{4k}p19?%{btOKa>CB9liW%OZ{#Igzv-4D!tjc@o?qvsyq{QC#LHoCU} literal 0 HcmV?d00001 diff --git a/target/classes/sf/codingcompetition2020/Bar.class b/target/classes/sf/codingcompetition2020/Bar.class new file mode 100644 index 0000000000000000000000000000000000000000..182a059f9c29e9472d8bdf086ef84bfa9693a33b GIT binary patch literal 464 zcmaJ-O;5r=5Pe$;NG+h?XJQN|186LA)p(FZW76nBQ^ng-R#;NHq%4~FuRIVF5B>mu zlySCrGRDiyy!m=>=JV_Q1Hcis^RO6prjK5z`Z6AbYCI8IYN_IOtKIU>c#?3ZT@UD9!5o(5Ps3Mh6$xmziS$iFmIcBh@@ literal 0 HcmV?d00001 diff --git a/target/classes/sf/codingcompetition2020/BarGraph.class b/target/classes/sf/codingcompetition2020/BarGraph.class new file mode 100644 index 0000000000000000000000000000000000000000..ac91d5a167df05bd2fe3b47b825b2dce1b4eb470 GIT binary patch literal 2102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vlIsdYCW*D@_^EWS=T-??;0RrpGmbJI(xxDg@3c zMq?DX%Psi9MsuRCWfZ1WnHs4lRO?DskUoD04wmOwf_o%RgZF8r%PRCcDhWMx=e*> zh#hp2z)er|lp7;YON}DDOJHw~(z!4Jfp9EJ4+XV*)U*bSzGz~{rL>Fn`6`z}kLKC3 zr*lG8U){6Xs5G*TrOTPw*dRr?O5o`nt;?#O(Q9bodSvTa$2O6Dru43oeOp@VWJj|s zY+_Yy`ty@-ljx)_wb{`Tf$N^eX?fO_PM)}Y-7}V!HPCGW2XnL_YoPH5Y!6*V zFPgZpYRtbObgHO`aOz$2q~poDog?gjCyh%JirQx)mP$Y6ruQX3X5tC1m7;5V8+*JV zT9F)}&PN^rvpsmw@Mu3e<*WJf8OqN}_%VU+=Uu`f-WG5bz3PaV>nM?$#g7%5rSR{1 z!;@aa=fi%kz)RrYd5?eaYI)X6mlp3cyvsT@&uc0M6kR?w0Vlgm+~;6Fe{8dI`l} z@S*?#9_?d*D;NxLei(q~*YJ+O>u>?1F5-0o-pC;L5pChYZ?N)g5d`y+cgA%#<< zz>(g9w~=RM{FCsGhj80Vcn{upT0U^31*awSkREzT>+qo?U2~*GN4oAIJ@%4r!iFQ2 z9BJYYIz8jho|kk7K60eHj#O}(e53;}sSKNrbkC6{*=>0=aWCmUJaD8>9BJaXPty-x g(nENZyZS$Q37^8Y(^7F-{@dxFy`(C7T7b{~2FpNm>;M1& diff --git a/target/classes/sf/codingcompetition2020/HomeScreen.class b/target/classes/sf/codingcompetition2020/HomeScreen.class new file mode 100644 index 0000000000000000000000000000000000000000..55eb63bc3b98853e5c1e7e50dd38211614da1b05 GIT binary patch literal 2017 zcmb7F?^hZ}6uo0WkPxNDU}@TfBt}7rt2S+{q^3%u!9rrI!J72f2qSI|?0R+=P5!I) z3-;7=@}=MUNA>j1E*`OH+J2ek&CI*+zW44M{`~9rcK~Lw8$qAI9e3BL+BMUvSMBD$ z@=VXPt+|=G8RMzlR2x-CDJz1IK;pGLkVZpVb>sQYYgP3GuE@HwycM&d)}^;6FkCvl zv*9_!%=1#gwp>qIUPU%qDvAMt3D>C_O=((&qg=b?RF!KymY&o|uHl2a(^dC?&eeuA znNjRteLjsfU4SwR%ffzhcR?Y4L7#7I97a(xxxc5IaEz?^R zxRl9O1VRP7ree5+(KxPRL|~|7TIyM=xucv-xzkX(gmzUnD$+5v-PsIzd!{RJxAY%+ z#fpb?X$6v*SH1nnRwB45Fm@r*lB1*>v^|C!7}d+|IPPFfAm%EsV!Ec!G?aPi=Ompv zxm`UcmO#Jj>qlVxV(MK1$vsgq)!~wsmAm{_9|>$`E_P-?sj>oqbG74bNG~ns4LIsU$9%2SG0m0 zCNjOedUvu#9saX8KF0%rK_YQ>Jl0}eTGU1|lMQ_2p=an5wplq$j?B97|Xh7+{kFe}U^A+WKCwSC$s%)5&YB z$5@Hr302%(#%23W9IJTB5bVA5R7E+SNlmYE`g?L{?%Njg%WGn5aeR#uXGPX(tbA8! z-QVEenF5?_M)2&Py)4Nc)rewUAQg;P+TKkE4@=s#(vr*;VkqNVU7ihrYv=Swr&z{| zI4al@7}47Aq_Wg7>sFJzIcpietW#JMi15kM8WhO=AH@BF7GK>Q;uJR9youOmtq_K%d6i;w(#_^pVr;PEwB;%n+V|}gwanc zLaPr^+OaPCGVLo}_8{#HxqfQe5M~1p-~C zHGq%t33s&f8VU6AJ9vy6+eb*3rb2DpIz<`uDc>Z?G)dj|(UO4&?qZytQAV0ThIj+W zVzPt#ho2&_dWP_c2H#k0yTQ|LH!MisRa}O literal 0 HcmV?d00001 diff --git a/target/classes/sf/codingcompetition2020/structures/Agent.class b/target/classes/sf/codingcompetition2020/structures/Agent.class index 26bf31f236fb6fb54997543cc9d682faad0ab137..0f1ac4e19d8ce9d63b4f6bf28f8db36e1e6ac5e2 100644 GIT binary patch literal 1330 zcmb7DZBNrs7(I7v>sG3R0Sbyb5usb_it_~(Ut&y1mQ4JBAu)a`qs)@6C2i;b@PGJ0 z6A`0{KfoVlJogq@gnrO3eV%*!oO{lB?sI?r{{9odZ9LJC6R5|#PB+}~gI+fr?0boy z_+ijmX{|VM5)He_F!EyOdCvuq^xdH6yxQLLx`}}1%D?R$0nrx7yOHM# zR6C=>%_QRSYXT*S8?s!Wyz57Cvf&PxbNe_gKK27Yc`7hw*0*@ri*U!&F@^~P2F?jo zI)3173h{@EPWRrcK|_SU0tkO~%fW}bCX z|Bo|uuwf<4u`{-g%ebOp{;w9MLb-i_8 z4uY~eRW;y9hMfy^au2iHaM!p3(VZ@#1>JFn|EHn;L`K-z&`PEqj zHX+Z#Dl;Q3!W5>tDq{v0jt=-hdMRM_2gI90TYj`>|yr~Vwq)ZZ5@eLNv6s?GTfZvywRngKRPN>gwx6Z{|(+&B$h%mhEo1ly;< UW+wPiCb)STY-fVkRA(Ol0f{^AhyVZp delta 89 zcmdnQwT4;X)W2Q(7#J7~8N}Hcm>3x}Cp$7~PPBY5`81Qa4kH620}lf)kmLg@(Ff9u fK$=x+I|KhlAcKiP5J<9t1(_$uvxu^bfAcG}WsWZm`MctapRU)d8VYzBu?M;?O)F2N8OY`DIB*=Zff@Rfbw zNr90@;Mm@t9lGk?br#|yHxe)#|2)MSvD^MB?fU+Ly{{0L4V2NR zteOEGB|fRg7gW!7)^m5W+(053KE54>0;3r-Q!Y&zC%RKYqDrW(e&sqRud*9$b_K=+ zN=zkepHrE>8+1ZPZn;W8dV;p3+QBp%&GRcLAg6XhE2lP+oSY*$IR(!WBUB{w`+2*^ zQ}8SfvLl^R63I|g3-i(8Dm|5_oP+CtKT7BpW;emVdUx;jBlIO zeC;c4onY3i7E)`@tQKiiPGFhUQtDeVKe9LnMLNljfdTG)kiQ{}lX`}fizIzSLeVys delta 62 zcmeC->Sg9S^>5cc1_lO02C<1;KPJCna^`1bU}WHC-~p1nKneZHcFbbzY(O3Z1M}n$ NETZfpKo%2&C;-$@3q1e; diff --git a/target/classes/sf/codingcompetition2020/structures/Customer.class b/target/classes/sf/codingcompetition2020/structures/Customer.class index 844ea29474f5bc9dd328dee078d97b0567ad1de8..fa809ab4283ea37ca9270dcd88a43fade29b6b3a 100644 GIT binary patch literal 2642 zcmb7ETT>iG6h6ak+0DQP2=T5PqXsZ$3El&V5(3G_$n&6X3R+kt6onUt5>iHVz1=V-vAi%-OnD2F0yl-Kv4$iR412)YiHx<_8c zqx^x=iCGg(>Ct%g6i_o7ndUtj4n=D37Y%p~2rY$2Ib0&cVJ_IyrZ4~?Xw9QyORJ{P zohnkdEvQhJEg98;NKn^tp0-h8xvCO_Ecu#hM1p(pXfb16sGg_uduf9CJBU{}#1uB- zPz4>7vbaBXcQuKlHMmwY(%&kN9Hi>Y-rh3?WRYg9Vv9Oeo&M8NChaYcq9*1 z5Xz(yC8!jwPxMTzf{+cVk$h-DMataqsDEmD2LoG*>#{)oRPyO{dINE)Dw1pM=DyTh zVn4K#j{_0z2(9?uRSuX#g=yV5SNrMWk-peM*>Xk4&Eq9{ba$$!&hBQXUo32nrV#n` zeJpDo>tUMl=;!SSFE0*{WWB^MQ-yd5aa3yQ7`-%;Tctw&egZ`xq9`_{eOWs3H*ran zOs6H!p-q3rt3)h zU~VuW=nDM$@ux0QAHNx#`uHtaiQQX?g|Em?`dA=yGj_vgHdWc+&~4 zWx>)3-gbg_vS8%|f8!k7Zno#96a1}nW#45p|KtRJPd_*Y_G314+X>#cGz$I$r_}1E delta 80 zcmca4vW$)E)W2Q(7#J7~8Pqp&=`l_2WnHGj$iT=T!ypSJ<$yB!K$;OqvubT;klzSo WFfk|sNj9(`*W`Y7QFc|Zs2Tv5KMWoK diff --git a/target/classes/sf/codingcompetition2020/structures/Vendor.class b/target/classes/sf/codingcompetition2020/structures/Vendor.class index fdbca9b6e0183e880547b8ff174552c31967ec4f..44022e39f51017efe76eb91ee48fb8a977ee1733 100644 GIT binary patch literal 1313 zcmb7D?M~EC5IuLlx|Hg|0xBv9D(qLKuqb|j2%3;=vT7oRMEq5{*R^D6H*J@v@KOAs ziHOm}2k@bcr|kj(YNBb3%XZq9yVsS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