import java.util.*; /** * A class that defines a new permutation code, as well as methods for encoding * and decoding of the messages that use this code. */ class PermutationCode { // The original list of characters to be encoded ArrayList alphabet = new ArrayList(Arrays.asList( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')); ArrayList code = new ArrayList(26); // A random number generator Random rand = new Random(); // Create a new instance of the encoder/decoder with a new permutation code PermutationCode() { this.code = this.initEncoder(); } // Create a new instance of the encoder/decoder with the given code PermutationCode(ArrayList code) { this.code = code; } // Initialize the encoding permutation of the characters ArrayList initEncoder() { return this.alphabet; //you should complete this method } // produce an encoded String from the given String String encode(String source) { return ""; //you should complete this method } // produce a decoded String from the given String String decode(String code) { return ""; //you should complete this method } }