com.octo.captcha.component.word
Class DefaultSizeSortedWordList

java.lang.Object
  extended by com.octo.captcha.component.word.DefaultSizeSortedWordList
All Implemented Interfaces:
SizeSortedWordList

public class DefaultSizeSortedWordList
extends java.lang.Object
implements SizeSortedWordList

Container for words that is initialized from a Dictionnary.

Version:
1.0
Author:
Marc-Antoine Garrigue

Constructor Summary
DefaultSizeSortedWordList(java.util.Locale locale)
          A word list has to be constructed with a locale
 
Method Summary
 void addWord(java.lang.String word)
          Adds a word to the list
 java.util.Locale getLocale()
          Return a locale for this list
 java.lang.Integer getMaxWord()
          Return the max length of contained word in this wordlist
 java.lang.Integer getMinWord()
          Return the min length of contained word in this wordlist
 java.lang.String getNextWord(java.lang.Integer length)
          Return a word of randomly choosen of the specified length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSizeSortedWordList

public DefaultSizeSortedWordList(java.util.Locale locale)
A word list has to be constructed with a locale

Method Detail

getLocale

public java.util.Locale getLocale()
Return a locale for this list

Specified by:
getLocale in interface SizeSortedWordList
Returns:
th e locale

addWord

public void addWord(java.lang.String word)
Adds a word to the list

Specified by:
addWord in interface SizeSortedWordList

getMinWord

public java.lang.Integer getMinWord()
Return the min length of contained word in this wordlist

Specified by:
getMinWord in interface SizeSortedWordList
Returns:
the min length of contained word in this wordlist

getMaxWord

public java.lang.Integer getMaxWord()
Return the max length of contained word in this wordlist

Specified by:
getMaxWord in interface SizeSortedWordList
Returns:
the max length of contained word in this wordlist

getNextWord

public java.lang.String getNextWord(java.lang.Integer length)
Return a word of randomly choosen of the specified length. Return null if none found

Specified by:
getNextWord in interface SizeSortedWordList
Returns:
a word of this length


Copyright © 2003-2012 JCaptcha corp.. All Rights Reserved.