org.problets.lib
Class HistoryChecker
java.lang.Object
org.problets.lib.HistoryChecker
public class HistoryChecker
- extends java.lang.Object
Helps other classes determine whether a number was
generated in the last N tries, N being the size of the history.
Set the size to match the number of entries that must be consecutively unique,
not the number of possible entries in the client.
- Author:
- Amruth Kumar
Method Summary |
void |
add(int entry)
Adds an entry to the history |
boolean |
alreadyGenerated(int entry)
Returns true if the entry has already been generated, and false otherwise |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HistoryChecker
public HistoryChecker(int inSize,
int inInitialValue)
alreadyGenerated
public boolean alreadyGenerated(int entry)
- Returns true if the entry has already been generated, and false otherwise
add
public void add(int entry)
- Adds an entry to the history