public String getHumanOutput() { String results = ""; Set<String> leftOverCategoryNames = this.environment.getCategories().keySet(); for (ProfileFile[] round : this.files) { for (ProfileFile file : round) { String fileName = file.getFileName(); results += "###### " + fileName + "\n"; if (file.getType() == ProfileFile.TYPE_2D) { Vector<String> values = this.environment.getVars(fileName, "list"); results += Profile.array2DToString(values, "", "\n", "\n") + "\n"; leftOverCategoryNames.remove(fileName); } else if (file.getType() == ProfileFile.TYPE_3D) { HashMap<String, Vector<String>> category = this.environment.getCategoryKeys(fileName); results += Profile.array3DToString(category, " ", " ", "") + "\n"; leftOverCategoryNames.remove(fileName); } else if (file.getType() == ProfileFile.TYPE_KEYVAL_BASH) { HashMap<String, Vector<String>> category = this.environment.getCategoryKeys(fileName); results += Profile.array3DToString(category, "=\"", " ", "\"") + "\n"; leftOverCategoryNames.remove(fileName); } } } if (verbose) { // Warn about unhandled data for (String categoryName : leftOverCategoryNames) { HashMap<String, Vector<String>> keys = this.environment.getCategoryKeys(categoryName); Set<String> keyNames = keys.keySet(); for (String keyName : keyNames) { System.err.println("Warning: unhandled data: " + keyName); } } } return results; }
public void mergeFilesToEnvironment(ProfileFile[] files, ProfileEnvironment environment) throws FileNotFoundException, IOException { for (ProfileFile currFile : files) { currFile.mergeToEnvironment(environment); } }