com.octo.captcha.component.word.wordgenerator
Class RandomWordGenerator

java.lang.Object
  extended by com.octo.captcha.component.word.wordgenerator.RandomWordGenerator
All Implemented Interfaces:
WordGenerator

public class RandomWordGenerator
extends java.lang.Object
implements WordGenerator

Random word generator. must be constructed with a String containing all possible chars


Constructor Summary
RandomWordGenerator(java.lang.String acceptedChars)
           
 
Method Summary
 java.lang.String getWord(java.lang.Integer length)
          Return a word of length between min and max length
 java.lang.String getWord(java.lang.Integer length, java.util.Locale locale)
          Return a word of length between min and max length according to the given locale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomWordGenerator

public RandomWordGenerator(java.lang.String acceptedChars)
Method Detail

getWord

public java.lang.String getWord(java.lang.Integer length)
Return a word of length between min and max length

Specified by:
getWord in interface WordGenerator
Returns:
a String of length between min and max length

getWord

public java.lang.String getWord(java.lang.Integer length,
                                java.util.Locale locale)
Return a word of length between min and max length according to the given locale

Specified by:
getWord in interface WordGenerator
Parameters:
length - the word length
Returns:
a String of length between min and max length according to the given locale


Copyright 2003-2009 JCaptcha. All Rights Reserved.