better class name

This commit is contained in:
rusefillc 2023-12-15 10:36:00 -05:00
parent 3e2f3fd5eb
commit aa5b1f2fea
2 changed files with 8 additions and 8 deletions

View File

@ -11,14 +11,14 @@ public class ByteRateOfChangeReports {
/**
* sweet baby O(n^2)
*/
public static void compareEachReportAgainstAllOthers(String reportDestinationFolder, List<ByteRateOfChange.TraceReport> reports, CanContext context) throws FileNotFoundException {
public static void compareEachReportAgainstAllOthers(String reportDestinationFolder, List<ByteRateOfChange.TraceReport> reports, CanMetaDataContext context) throws FileNotFoundException {
for (int i = 0; i < reports.size(); i++) {
for (int j = i + 1; j < reports.size(); j++)
compareTwoReports(reportDestinationFolder, reports.get(i), reports.get(j), context);
}
}
private static void compareTwoReports(String reportDestinationFolder, ByteRateOfChange.TraceReport traceReport1, ByteRateOfChange.TraceReport traceReport2, CanContext context) throws FileNotFoundException {
private static void compareTwoReports(String reportDestinationFolder, ByteRateOfChange.TraceReport traceReport1, ByteRateOfChange.TraceReport traceReport2, CanMetaDataContext context) throws FileNotFoundException {
Set<ByteRateOfChange.ByteId> allKeys = new TreeSet<>();
allKeys.addAll(traceReport1.getStatistics().keySet());
allKeys.addAll(traceReport2.getStatistics().keySet());
@ -92,7 +92,7 @@ public class ByteRateOfChangeReports {
public static void scanInputFolder(String inputFolderName, String fileNameSuffix) throws IOException {
String reportDestinationFolder = createOutputFolder(inputFolderName);
CanContext context = CanContext.read(inputFolderName);
CanMetaDataContext context = CanMetaDataContext.read(inputFolderName);
List<ByteRateOfChange.TraceReport> reports = new ArrayList<>();

View File

@ -7,13 +7,13 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.*;
public class CanContext {
public class CanMetaDataContext {
final Set<Integer> withChecksum = new HashSet<>();
final Map<Integer, Map<Integer, Integer>> countersMap;
Set<ByteRateOfChange.ByteId> counterBytes = new HashSet<>();
private CanContext(List<Integer> withChecksum, Map<Integer, Map<Integer, Integer>> countersMap) {
private CanMetaDataContext(List<Integer> withChecksum, Map<Integer, Map<Integer, Integer>> countersMap) {
this.countersMap = countersMap;
this.withChecksum.addAll(withChecksum);
@ -33,17 +33,17 @@ public class CanContext {
}
}
public static CanContext read(String inputFolderName) throws FileNotFoundException {
public static CanMetaDataContext read(String inputFolderName) throws FileNotFoundException {
Yaml checksum = new Yaml();
String checkSumFileName = inputFolderName + File.separator + ChecksumScanner.CHECKSUM_YAML;
if (!new File(checkSumFileName).exists())
return new CanContext(new ArrayList<>(), new HashMap<>());
return new CanMetaDataContext(new ArrayList<>(), new HashMap<>());
List<Integer> withChecksum = checksum.load(new FileReader(checkSumFileName));
Yaml countersYaml = new Yaml();
Map<Integer, Map<Integer, Integer>> countersMap = countersYaml.load(new FileReader(inputFolderName + File.separator + CounterScanner.COUNTERS_YAML));
return new CanContext(withChecksum, countersMap);
return new CanMetaDataContext(withChecksum, countersMap);
}
}