Package adams.core.password
Class DictionaryBasedGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.password.AbstractPasswordGenerator
-
- adams.core.password.DictionaryBasedGenerator
-
- All Implemented Interfaces:
LoggingLevelHandler
,LoggingSupporter
,PasswordGenerator
,SizeOfHandler
,Serializable
,Iterator<String>
public class DictionaryBasedGenerator extends AbstractPasswordGenerator
Generator that uses a dictionary as basis.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DictionaryBasedGenerator.Variation
Defines what variations of the password from the dictionary will be generated.
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
m_Dictionary
the dictionary entries.protected PlaceholderFile
m_DictionaryFile
the dictionary file to use.protected int
m_Index
the current index in the dictionary.protected List<String>
m_Passwords
the current passwords to output.protected DictionaryBasedGenerator.Variation[]
m_Variations
the variations to generate.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description DictionaryBasedGenerator(PlaceholderFile dictionaryFile)
Initializes the generator.DictionaryBasedGenerator(PlaceholderFile dictionaryFile, DictionaryBasedGenerator.Variation[] variations)
Initializes the generator.DictionaryBasedGenerator(List<String> dictionary)
Initializes the generator.DictionaryBasedGenerator(List<String> dictionary, DictionaryBasedGenerator.Variation[] variations)
Initializes the generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Checks whether there is another password available.protected void
initialize()
Initializes the generator.String
next()
Returns the next password.-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
-
-
-
Field Detail
-
m_DictionaryFile
protected PlaceholderFile m_DictionaryFile
the dictionary file to use.
-
m_Variations
protected DictionaryBasedGenerator.Variation[] m_Variations
the variations to generate.
-
m_Index
protected int m_Index
the current index in the dictionary.
-
-
Constructor Detail
-
DictionaryBasedGenerator
public DictionaryBasedGenerator(PlaceholderFile dictionaryFile)
Initializes the generator.- Parameters:
dictionaryFile
- the dictionary to use
-
DictionaryBasedGenerator
public DictionaryBasedGenerator(PlaceholderFile dictionaryFile, DictionaryBasedGenerator.Variation[] variations)
Initializes the generator.- Parameters:
dictionaryFile
- the dictionary to usevariations
- the variations of the words in the dictionary to generate, can be null
-
DictionaryBasedGenerator
public DictionaryBasedGenerator(List<String> dictionary)
Initializes the generator.- Parameters:
dictionary
- the words to use
-
DictionaryBasedGenerator
public DictionaryBasedGenerator(List<String> dictionary, DictionaryBasedGenerator.Variation[] variations)
Initializes the generator.- Parameters:
dictionary
- the words to usevariations
- the variations of the words in the dictionary to generate, can be null
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the generator.
-
hasNext
public boolean hasNext()
Checks whether there is another password available.- Specified by:
hasNext
in interfaceIterator<String>
- Specified by:
hasNext
in classAbstractPasswordGenerator
- Returns:
- true if another password available
-
-