@Test public void runTest() { assertEquals("00000101000100000110001011010110001010", AdaptiveHuffman.adaptiveHuffman("aardvark", Mode.ENCODE)); assertEquals("aardvark", AdaptiveHuffman.adaptiveHuffman("00000101000100000110001011010110001010", Mode.DECODE)); }
public static String adaptiveHuffman(String input, Mode mode) { String output = ""; if (mode == Mode.ENCODE) { AdaptiveHuffmanEncode adaptiveHuffmanEncode = new AdaptiveHuffmanEncode(); output = adaptiveHuffmanEncode.Encode(input); } if (mode == Mode.DECODE) { AdaptiveHuffmanDecode adaptiveHuffmanDecode = new AdaptiveHuffmanDecode(); output = adaptiveHuffmanDecode.Decode(input); } return output; }
AdaptiveHuffman { public static String adaptiveHuffman(String input, Mode mode) { String output = ""; if (mode == Mode.ENCODE) { AdaptiveHuffmanEncode adaptiveHuffmanEncode = new AdaptiveHuffmanEncode(); output = adaptiveHuffmanEncode.Encode(input); } if (mode == Mode.DECODE) { AdaptiveHuffmanDecode adaptiveHuffmanDecode = new AdaptiveHuffmanDecode(); output = adaptiveHuffmanDecode.Decode(input); } return output; } }
AdaptiveHuffman { public static String adaptiveHuffman(String input, Mode mode) { String output = ""; if (mode == Mode.ENCODE) { AdaptiveHuffmanEncode adaptiveHuffmanEncode = new AdaptiveHuffmanEncode(); output = adaptiveHuffmanEncode.Encode(input); } if (mode == Mode.DECODE) { AdaptiveHuffmanDecode adaptiveHuffmanDecode = new AdaptiveHuffmanDecode(); output = adaptiveHuffmanDecode.Decode(input); } return output; }  }
AdaptiveHuffman { public static String adaptiveHuffman(String input, Mode mode) { String output = ""; if (mode == Mode.ENCODE) { AdaptiveHuffmanEncode adaptiveHuffmanEncode = new AdaptiveHuffmanEncode(); output = adaptiveHuffmanEncode.Encode(input); } if (mode == Mode.DECODE) { AdaptiveHuffmanDecode adaptiveHuffmanDecode = new AdaptiveHuffmanDecode(); output = adaptiveHuffmanDecode.Decode(input); } return output; }  static String adaptiveHuffman(String input, Mode mode); }
AdaptiveHuffman { public static String adaptiveHuffman(String input, Mode mode) { String output = ""; if (mode == Mode.ENCODE) { AdaptiveHuffmanEncode adaptiveHuffmanEncode = new AdaptiveHuffmanEncode(); output = adaptiveHuffmanEncode.Encode(input); } if (mode == Mode.DECODE) { AdaptiveHuffmanDecode adaptiveHuffmanDecode = new AdaptiveHuffmanDecode(); output = adaptiveHuffmanDecode.Decode(input); } return output; }  static String adaptiveHuffman(String input, Mode mode);  }