Class AbstractCodingDevice

java.lang.Object
  extended by AbstractCodingDevice
All Implemented Interfaces:
CodingDevice
Direct Known Subclasses:
Ceasar, Vernam

public abstract class AbstractCodingDevice
extends Object
implements CodingDevice

Abstract class AbstractCodingDevice represent common type of Coding device. Saves value of key.

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

Constructor Summary
AbstractCodingDevice(String key)
          Constructor
 
Method Summary
abstract  String decode(String text)
          Decodes text with the key
abstract  String encode(String text)
          Encodes text with the key
 String getKey()
          Get key value
 void setKey(String key)
          Set up key value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCodingDevice

public AbstractCodingDevice(String key)
Constructor

Parameters:
key - is coding passphrase
Method Detail

decode

public abstract String decode(String text)
Description copied from interface: CodingDevice
Decodes text with the key

Specified by:
decode in interface CodingDevice
Parameters:
text - text to decoded
Returns:
decoded text

encode

public abstract String encode(String text)
Description copied from interface: CodingDevice
Encodes text with the key

Specified by:
encode in interface CodingDevice
Parameters:
text - text to be encoded
Returns:
encoded text

getKey

public String getKey()
Get key value

Specified by:
getKey in interface CodingDevice
Returns:
key value

setKey

public void setKey(String key)
Set up key value

Specified by:
setKey in interface CodingDevice
Parameters:
key - is coding passphrase