java.lang.Object LockBox
public class LockBox
Class that password protects a text message.
Constructor Summary | |
---|---|
LockBox(java.lang.String password)
Constructs a LockBox object. |
Method Summary | |
---|---|
java.lang.String |
access(java.lang.String password)
Accesses the stored message. |
int |
numberOfAccesses()
Accessor for the number of valid accesses since the message was set. |
int |
numberOfFailedAttempts()
Accessor for the number of failed access attempts since the message was set. |
boolean |
setMessage(java.lang.String password,
java.lang.String message)
Sets the stored message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LockBox(java.lang.String password)
password
- the password used to lock/unlock the boxMethod Detail |
---|
public java.lang.String access(java.lang.String password)
password
- the password used to lock/unlock the box
public int numberOfAccesses()
public int numberOfFailedAttempts()
public boolean setMessage(java.lang.String password, java.lang.String message)
password
- the password used to lock/unlock the boxmessage
- the message to be stored