Class Ceasar

java.lang.Object
  extended by AbstractCodingDevice
      extended by Ceasar
All Implemented Interfaces:
CodingDevice

public class Ceasar
extends AbstractCodingDevice

Implements Ceasar's coding algorithm

Version:
29 10 2009
Author:
Tomas Sedmik, xsedmik@fi.muni.cz

Constructor Summary
Ceasar(String key)
          Constructor that sets the key.
 
Method Summary
 String decode(String text)
          Decode a message
 String encode(String text)
          Encode a message
 
Methods inherited from class AbstractCodingDevice
getKey, setKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ceasar

public Ceasar(String key)
Constructor that sets the key.

Parameters:
key - used for encoding/decoding
Method Detail

decode

public String decode(String text)
Decode a message

Specified by:
decode in interface CodingDevice
Specified by:
decode in class AbstractCodingDevice
Parameters:
text - message which will be decoded
Returns:
decoded text

encode

public String encode(String text)
Encode a message

Specified by:
encode in interface CodingDevice
Specified by:
encode in class AbstractCodingDevice
Parameters:
text - message which will be encoded
Returns:
encoded text