From 461cdc1697d108e628aebb28506a4e069c1a33c4 Mon Sep 17 00:00:00 2001 From: LiuZihan <1353843969@qq.com> Date: Thu, 26 Mar 2026 20:11:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'project/ResultDisplay.jav?= =?UTF-8?q?a'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/ResultDisplay.java | 101 ------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 project/ResultDisplay.java diff --git a/project/ResultDisplay.java b/project/ResultDisplay.java deleted file mode 100644 index 2e716ba..0000000 --- a/project/ResultDisplay.java +++ /dev/null @@ -1,101 +0,0 @@ -package java01; - -import java.util.Map; - -public class ResultDisplay { - - // 控制台输出技能词频统计 - public void displaySkillFrequency(Map skillFrequency) { - System.out.println("\n=== 技能词频统计 ==="); - System.out.printf("%-20s %s\n", "技能", "出现次数"); - System.out.println("------------------------"); - - int count = 0; - for (Map.Entry entry : skillFrequency.entrySet()) { - if (count < 20) { // 只显示前20个 - System.out.printf("%-20s %d\n", entry.getKey(), entry.getValue()); - count++; - } - } - } - - // 控制台输出薪资与经验关系 - public void displaySalaryByExperience(Map salaryByExperience) { - System.out.println("\n=== 薪资与经验关系 ==="); - System.out.printf("%-15s %s\n", "经验", "平均薪资(元)"); - System.out.println("------------------------"); - - for (Map.Entry entry : salaryByExperience.entrySet()) { - System.out.printf("%-15s %.2f\n", entry.getKey(), entry.getValue()); - } - } - - // 控制台输出薪资与学历关系 - public void displaySalaryByEducation(Map salaryByEducation) { - System.out.println("\n=== 薪资与学历关系 ==="); - System.out.printf("%-15s %s\n", "学历", "平均薪资(元)"); - System.out.println("------------------------"); - - for (Map.Entry entry : salaryByEducation.entrySet()) { - System.out.printf("%-15s %.2f\n", entry.getKey(), entry.getValue()); - } - } - - // 控制台输出不同地点薪资水平 - public void displaySalaryByLocation(Map salaryByLocation) { - System.out.println("\n=== 不同地点薪资水平 ==="); - System.out.printf("%-15s %s\n", "地点", "平均薪资(元)"); - System.out.println("------------------------"); - - for (Map.Entry entry : salaryByLocation.entrySet()) { - System.out.printf("%-15s %.2f\n", entry.getKey(), entry.getValue()); - } - } - - // 控制台输出薪资分布 - public void displaySalaryDistribution(Map salaryDistribution) { - System.out.println("\n=== 薪资分布 ==="); - System.out.printf("%-15s %s\n", "薪资范围", "职位数量"); - System.out.println("------------------------"); - - for (Map.Entry entry : salaryDistribution.entrySet()) { - System.out.printf("%-15s %d\n", entry.getKey(), entry.getValue()); - } - } - - // 生成技能词频柱状图(控制台文本版本) - public void generateSkillFrequencyChart(Map skillFrequency, String fileName) { - System.out.println("\n=== 技能词频统计图表 ==="); - int count = 0; - for (Map.Entry entry : skillFrequency.entrySet()) { - if (count < 10) { - System.out.printf("%-20s ", entry.getKey()); - // 用星号表示频率 - for (int i = 0; i < Math.min(entry.getValue(), 50); i++) { - System.out.print("*"); - } - System.out.println(" " + entry.getValue()); - count++; - } - } - System.out.println("技能词频图表已生成(文本版本)"); - } - - // 生成薪资分布饼图(控制台文本版本) - public void generateSalaryDistributionChart(Map salaryDistribution, String fileName) { - System.out.println("\n=== 薪资分布图表 ==="); - for (Map.Entry entry : salaryDistribution.entrySet()) { - System.out.printf("%-15s %d\n", entry.getKey(), entry.getValue()); - } - System.out.println("薪资分布图表已生成(文本版本)"); - } - - // 生成薪资与经验关系折线图(控制台文本版本) - public void generateSalaryByExperienceChart(Map salaryByExperience, String fileName) { - System.out.println("\n=== 薪资与经验关系图表 ==="); - for (Map.Entry entry : salaryByExperience.entrySet()) { - System.out.printf("%-15s %.2f\n", entry.getKey(), entry.getValue()); - } - System.out.println("薪资与经验关系图表已生成(文本版本)"); - } -} \ No newline at end of file