/*
 * 2004 Utah High School Programming Contest, University of Utah
 * Take-Home Problem
 *
 * Cipher.java
 *
 * This file contains the definition of the Cipher interface.
 */

/**
 * Cipher describes an object that represents a possible decryption method:
 * e.g., a particular rotation algorithm or a particular substitution
 * algorithm.  The primary method of a Cipher is `decipher', which applies the
 * Cipher's algorithm to a given StringBuffer.  The Cipher itself is only
 * responsible for applying its algorithm.  A Puzzle object is responsible for
 * deciding whether or not a Cipher's algorithm is actually the "right" one for
 * decrypting a message.
 *
 * Cipher defines a common interface for all kinds of ciphers, but does not
 * itself provide any implementation for ciphers.  The actual details of
 * creating ciphers and implementing decryption algorithms are contained in the
 * classes that implement Cipher: RotationCipher and SubstitutionCipher.
 */
interface Cipher {
    /**
     * Modify the given StringBuffer by applying this Cipher's algorithm to it.
     * This may or may not actually decrypt the StringBuffer into English text;
     * the caller must decide if this Cipher's algorithm actually "worked."
     *
     * @param cryptogram    the StringBuffer to be modified
     */
    void decipher(StringBuffer cryptogram);
}

// End of file.

