From 0c9f58a7ea76c8f4d52e3e501a13c06807ec04a5 Mon Sep 17 00:00:00 2001 From: warriordog Date: Fri, 18 Jul 2014 23:25:49 -0400 Subject: [PATCH] Add javadoc --- .../OBFUtil/parse/types/CSVFileParser.java | 3 +++ .../OBFUtil/parse/types/MCPCSVFileParser.java | 14 ++++++++++++++ .../OBFUtil/table/DirectOBFTableSRG.java | 3 +++ .../acomputerdog/OBFUtil/table/OBFTableSRG.java | 3 +++ src/net/acomputerdog/OBFUtil/tool/BLConfigGen.java | 3 +++ src/net/acomputerdog/OBFUtil/util/MultiBind.java | 7 +++++++ src/net/acomputerdog/OBFUtil/util/TargetType.java | 6 ++++++ .../acomputerdog/OBFUtil/util/TripleStringMap.java | 12 +++++++++--- 8 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/net/acomputerdog/OBFUtil/parse/types/CSVFileParser.java b/src/net/acomputerdog/OBFUtil/parse/types/CSVFileParser.java index c63483e..689b750 100644 --- a/src/net/acomputerdog/OBFUtil/parse/types/CSVFileParser.java +++ b/src/net/acomputerdog/OBFUtil/parse/types/CSVFileParser.java @@ -134,6 +134,9 @@ private boolean isLineEmpty(String line) { } } + /** + * A code structure representing a CSV file + */ public static class CSVFile { private final Map> categories = new HashMap>(); private final List catNames = new ArrayList(); diff --git a/src/net/acomputerdog/OBFUtil/parse/types/MCPCSVFileParser.java b/src/net/acomputerdog/OBFUtil/parse/types/MCPCSVFileParser.java index 92dd3a4..501b6a6 100644 --- a/src/net/acomputerdog/OBFUtil/parse/types/MCPCSVFileParser.java +++ b/src/net/acomputerdog/OBFUtil/parse/types/MCPCSVFileParser.java @@ -35,6 +35,13 @@ public MCPCSVFileParser(TargetType type, boolean ignoreSides, int side) { this.ignoreSides = ignoreSides; } + /** + * Writes the data in a CSVFile to an OBFTable + * + * @param source The file where the data originated from. + * @param csv The CSVFile to read from + * @param table The OBFTable to write to. + */ @Override public void writeCSVToTable(File source, CSVFile csv, OBFTable table) { for (int rowNum = 0; rowNum < csv.size(); rowNum++) { @@ -45,6 +52,13 @@ public void writeCSVToTable(File source, CSVFile csv, OBFTable table) { } } + /** + * Creates a CSVFile representing the data in an OBFTable + * + * @param source The file where the data originated from. + * @param table The table containing the data. + * @return Return a CSVFile representing the data in the OBFTable + */ @Override public CSVFile readCSVFromTable(File source, OBFTable table) { CSVFile csv = new CSVFile(); diff --git a/src/net/acomputerdog/OBFUtil/table/DirectOBFTableSRG.java b/src/net/acomputerdog/OBFUtil/table/DirectOBFTableSRG.java index c068457..326ea0b 100644 --- a/src/net/acomputerdog/OBFUtil/table/DirectOBFTableSRG.java +++ b/src/net/acomputerdog/OBFUtil/table/DirectOBFTableSRG.java @@ -3,6 +3,9 @@ import net.acomputerdog.OBFUtil.util.TargetType; import net.acomputerdog.OBFUtil.util.TripleStringMap; +/** + * OBFTable that adds support for a third "searge" obfuscation name. Based on DirectOBFTable. + */ public class DirectOBFTableSRG extends DirectOBFTable implements OBFTableSRG { private final TripleStringMap packages = new TripleStringMap(); private final TripleStringMap classes = new TripleStringMap(); diff --git a/src/net/acomputerdog/OBFUtil/table/OBFTableSRG.java b/src/net/acomputerdog/OBFUtil/table/OBFTableSRG.java index aa82a1b..bfe7128 100644 --- a/src/net/acomputerdog/OBFUtil/table/OBFTableSRG.java +++ b/src/net/acomputerdog/OBFUtil/table/OBFTableSRG.java @@ -2,6 +2,9 @@ import net.acomputerdog.OBFUtil.util.TargetType; +/** + * Extension to OBFTable that adds support for a third "searge" obfuscation name. + */ public interface OBFTableSRG extends OBFTable { public void addPackageSRG(String obfName, String seargeName, String deObfName); diff --git a/src/net/acomputerdog/OBFUtil/tool/BLConfigGen.java b/src/net/acomputerdog/OBFUtil/tool/BLConfigGen.java index f835985..7af56dd 100644 --- a/src/net/acomputerdog/OBFUtil/tool/BLConfigGen.java +++ b/src/net/acomputerdog/OBFUtil/tool/BLConfigGen.java @@ -13,6 +13,9 @@ import java.io.IOException; import java.util.regex.Pattern; +/** + * Creates BlazeLoader configuration files from MCP config files. + */ public class BLConfigGen { public static void main(String[] args) throws IOException { if (args.length < 2) { diff --git a/src/net/acomputerdog/OBFUtil/util/MultiBind.java b/src/net/acomputerdog/OBFUtil/util/MultiBind.java index 5c910c5..3737880 100644 --- a/src/net/acomputerdog/OBFUtil/util/MultiBind.java +++ b/src/net/acomputerdog/OBFUtil/util/MultiBind.java @@ -3,6 +3,13 @@ import java.util.HashMap; import java.util.Map; +/** + * Similar to a HashMap, but with a category->key->value mapping. + * + * @param The category (1st) identifier type + * @param The key (2nd) identifier type + * @param The value type + */ public class MultiBind { private final Map> bindData = new HashMap>(); diff --git a/src/net/acomputerdog/OBFUtil/util/TargetType.java b/src/net/acomputerdog/OBFUtil/util/TargetType.java index d691c89..ea9ef61 100644 --- a/src/net/acomputerdog/OBFUtil/util/TargetType.java +++ b/src/net/acomputerdog/OBFUtil/util/TargetType.java @@ -28,6 +28,12 @@ public enum TargetType { this.aliases = aliases; } + /** + * Gets a TargetType from it's name or an aliase + * + * @param type The name to identify with + * @return Return the TargetType identified by type + */ public static TargetType getType(String type) { if (type == null) { return null; diff --git a/src/net/acomputerdog/OBFUtil/util/TripleStringMap.java b/src/net/acomputerdog/OBFUtil/util/TripleStringMap.java index 14a9b66..8ad4d3d 100644 --- a/src/net/acomputerdog/OBFUtil/util/TripleStringMap.java +++ b/src/net/acomputerdog/OBFUtil/util/TripleStringMap.java @@ -5,6 +5,9 @@ import java.util.HashMap; import java.util.Map; +/** + * Maps 3 strings together so that the entire set can be retrieved by using any of the strings as a key. + */ public class TripleStringMap { private final Map item1Map = new HashMap(); @@ -48,10 +51,13 @@ public boolean hasItem3(String item3) { return item3Map.containsKey(item3); } + /** + * A binding of three strings + */ public static class TSMItem { - private String item1; - private String item2; - private String item3; + private final String item1; + private final String item2; + private final String item3; private TSMItem(String item1, String item2, String item3) { this.item1 = item1;