Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
Add javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
warriordog committed Jul 19, 2014
1 parent 8ad325b commit 0c9f58a
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/net/acomputerdog/OBFUtil/parse/types/CSVFileParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ private boolean isLineEmpty(String line) {
}
}

/**
* A code structure representing a CSV file
*/
public static class CSVFile {
private final Map<String, List<String>> categories = new HashMap<String, List<String>>();
private final List<String> catNames = new ArrayList<String>();
Expand Down
14 changes: 14 additions & 0 deletions src/net/acomputerdog/OBFUtil/parse/types/MCPCSVFileParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions src/net/acomputerdog/OBFUtil/table/DirectOBFTableSRG.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions src/net/acomputerdog/OBFUtil/table/OBFTableSRG.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 3 additions & 0 deletions src/net/acomputerdog/OBFUtil/tool/BLConfigGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions src/net/acomputerdog/OBFUtil/util/MultiBind.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
import java.util.HashMap;
import java.util.Map;

/**
* Similar to a HashMap, but with a category->key->value mapping.
*
* @param <C> The category (1st) identifier type
* @param <K> The key (2nd) identifier type
* @param <V> The value type
*/
public class MultiBind<C, K, V> {
private final Map<C, Map<K, V>> bindData = new HashMap<C, Map<K, V>>();

Expand Down
6 changes: 6 additions & 0 deletions src/net/acomputerdog/OBFUtil/util/TargetType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 9 additions & 3 deletions src/net/acomputerdog/OBFUtil/util/TripleStringMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, TSMItem> item1Map = new HashMap<String, TSMItem>();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0c9f58a

Please sign in to comment.