com.tootsville.hangman
Class Censor

java.lang.Object
  extended by com.tootsville.hangman.Censor
All Implemented Interfaces:
AbstractCensor

public class Censor
extends java.lang.Object
implements AbstractCensor

Provides chat filtering.

Author:
cnicol

Constructor Summary
Censor()
           
 
Method Summary
static void addToAdjacentList(java.lang.String word)
          Add a word to the adjacent word list.
static void addToBlackList(java.lang.String word)
          Add a word to the Black list.
static void addToWhiteList(java.lang.String word)
          Add a word to the White list.
static void addToWorseList(java.lang.String word)
          Add a word to the Worse (Red) list.
 FilterResult checkLists(java.lang.String token)
          TODO: document this method (brpocock, Oct 13, 2009)
 void destroy()
          Release the hash tables.
 FilterResult filterMessage(java.lang.String text)
          Filter the message.
static int getBlackListLength()
          TODO: document this method (brpocock, Oct 13, 2009)
 int getWhiteListLength()
          TODO: document this method (brpocock, Oct 13, 2009)
static int getWorseListLength()
          TODO: document this method (brpocock, Oct 13, 2009)
static void init()
          Initialize the filtering word sets.
static void loadLists(java.sql.Connection db)
          TODO: document this method (brpocock, Oct 13, 2009)
static void prime(java.sql.Connection databaseConnection)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Censor

public Censor()
Method Detail

addToAdjacentList

public static void addToAdjacentList(java.lang.String word)
Add a word to the adjacent word list.

Parameters:
word - WRITEME

addToBlackList

public static void addToBlackList(java.lang.String word)
Add a word to the Black list.

Parameters:
word - WRITEME

addToWhiteList

public static void addToWhiteList(java.lang.String word)
Add a word to the White list.

Parameters:
word - WRITEME

addToWorseList

public static void addToWorseList(java.lang.String word)
Add a word to the Worse (Red) list.

Parameters:
word - WRITEME

getBlackListLength

public static int getBlackListLength()
TODO: document this method (brpocock, Oct 13, 2009)

Returns:
WRITEME

getWorseListLength

public static int getWorseListLength()
TODO: document this method (brpocock, Oct 13, 2009)

Returns:
WRITEME

init

public static void init()
Initialize the filtering word sets.


loadLists

public static void loadLists(java.sql.Connection db)
TODO: document this method (brpocock, Oct 13, 2009)

Parameters:
db - WRITEME

prime

public static void prime(java.sql.Connection databaseConnection)
Parameters:
databaseConnection - An open database connection over which the censorship records can be loaded

checkLists

public FilterResult checkLists(java.lang.String token)
Description copied from interface: AbstractCensor
TODO: document this method (brpocock, Oct 13, 2009)

Specified by:
checkLists in interface AbstractCensor
Parameters:
token - WRITEME
Returns:
WRITEME
See Also:
AbstractCensor.checkLists(java.lang.String)

destroy

public void destroy()
Release the hash tables.


filterMessage

public FilterResult filterMessage(java.lang.String text)
Description copied from interface: AbstractCensor
Filter the message.

Specified by:
filterMessage in interface AbstractCensor
Parameters:
text - WRITEME
Returns:
true if message should be filtered.
See Also:
AbstractCensor.filterMessage(java.lang.String)

getWhiteListLength

public int getWhiteListLength()
Description copied from interface: AbstractCensor
TODO: document this method (brpocock, Oct 13, 2009)

Specified by:
getWhiteListLength in interface AbstractCensor
Returns:
WRITEME
See Also:
AbstractCensor.getWhiteListLength()