|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.octo.captcha.engine.bufferedengine.buffer.MemoryCaptchaBuffer
public class MemoryCaptchaBuffer
Simple implmentation of a memory captcha buffer with HashedMap from commons collection.
Field Summary | |
---|---|
protected HashedMap |
buffers
|
Constructor Summary | |
---|---|
MemoryCaptchaBuffer()
|
Method Summary | |
---|---|
void |
clear()
Clear the buffer from all locale |
void |
dispose()
Release all the ressources and close the buffer. |
java.util.Collection |
getLocales()
Get all the locales used |
void |
putAllCaptcha(java.util.Collection captchas)
Put a collection of captchas with the default locale |
void |
putAllCaptcha(java.util.Collection captchas,
java.util.Locale locale)
Put a collection of captchas with his locale |
void |
putCaptcha(Captcha captcha)
Put a captcha with default laocale |
void |
putCaptcha(Captcha captcha,
java.util.Locale locale)
Put a captcha with a locale |
Captcha |
removeCaptcha()
remove a captcha from the buffer |
java.util.Collection |
removeCaptcha(int number)
Remove a precise number of captcha |
java.util.Collection |
removeCaptcha(int number,
java.util.Locale locale)
Remove a precise number of captcha with a locale |
Captcha |
removeCaptcha(java.util.Locale locale)
remove a captcha from the buffer corresponding to the locale |
int |
size()
Get the size of the buffer for all locales |
int |
size(java.util.Locale locale)
Get the size of the buffer for a locale |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HashedMap buffers
Constructor Detail |
---|
public MemoryCaptchaBuffer()
Method Detail |
---|
public Captcha removeCaptcha(java.util.Locale locale) throws java.util.NoSuchElementException
CaptchaBuffer
removeCaptcha
in interface CaptchaBuffer
locale
- The locale the catcha to remove
java.util.NoSuchElementException
- if there is no captcha throw NoSuchElementExceptionCaptchaBuffer.removeCaptcha(java.util.Locale)
public java.util.Collection removeCaptcha(int number, java.util.Locale locale)
CaptchaBuffer
removeCaptcha
in interface CaptchaBuffer
number
- The number of captchas to removelocale
- The locale of the removed captchas
CaptchaBuffer.removeCaptcha(int, java.util.Locale)
public java.util.Collection removeCaptcha(int number)
CaptchaBuffer
removeCaptcha
in interface CaptchaBuffer
number
- The number of captchas to remove
CaptchaBuffer.removeCaptcha(int)
public Captcha removeCaptcha() throws java.util.NoSuchElementException
CaptchaBuffer
removeCaptcha
in interface CaptchaBuffer
java.util.NoSuchElementException
- if there is no captcha throw NoSuchElementExceptionpublic void putCaptcha(Captcha captcha, java.util.Locale locale)
CaptchaBuffer
putCaptcha
in interface CaptchaBuffer
captcha
- The captcha to addlocale
- the locale of the captchapublic void putAllCaptcha(java.util.Collection captchas, java.util.Locale locale)
CaptchaBuffer
putAllCaptcha
in interface CaptchaBuffer
captchas
- The captchas to addlocale
- The locale of the captchasCaptchaBuffer.putAllCaptcha(java.util.Collection)
public int size()
CaptchaBuffer
size
in interface CaptchaBuffer
CaptchaBuffer.size()
public int size(java.util.Locale locale)
CaptchaBuffer
size
in interface CaptchaBuffer
locale
- the locale to get the size
CaptchaBuffer.size()
public void putCaptcha(Captcha captcha)
CaptchaBuffer
putCaptcha
in interface CaptchaBuffer
CaptchaBuffer.putCaptcha(com.octo.captcha.Captcha)
public void putAllCaptcha(java.util.Collection captchas)
CaptchaBuffer
putAllCaptcha
in interface CaptchaBuffer
captchas
- The captchas to addCaptchaBuffer.putAllCaptcha(java.util.Collection)
public void dispose()
CaptchaBuffer
dispose
in interface CaptchaBuffer
CaptchaBuffer.dispose()
public void clear()
CaptchaBuffer
clear
in interface CaptchaBuffer
CaptchaBuffer.clear()
public java.util.Collection getLocales()
CaptchaBuffer
getLocales
in interface CaptchaBuffer
CaptchaBuffer.getLocales()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |