|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Password
Model a good password.
A password is a String satisfying the following conditions
(close to those required of Unix passwords, according to
the man passwd
command in Unix):
Constructor Summary | |
Password(String password,
String notSubstringOf,
String doesNotContain)
Construct a new Password. |
Method Summary | |
static void |
main(String[] args)
Unit test for Password objects. |
void |
match(String guess)
See whether a supplied guess matches this password. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Password(String password, String notSubstringOf, String doesNotContain) throws BadPasswordException
password
- the new password.notSubstringOf
- a String that may not contain the password.doesNotContain
- a String the password may not contain.
BadPasswordException
- when password is unacceptable.Method Detail |
public static void main(String[] args)
public void match(String guess) throws BadPasswordException
guess
- the trial password.
BadPasswordException
- when match fails.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |