|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCounter
public class Counter
A Counter, with the ability to wrap and set the max value
Constructor Summary | |
---|---|
Counter()
Constructor taking no parameters, setting the default max value of 59 |
|
Counter(int max)
Constructor setting the max value Throws on non-positive integers. |
Method Summary | |
---|---|
void |
down()
Decrement counter by one |
boolean |
equals(java.lang.Object rhs)
Does this counter equal another one? |
static int |
nbrOfCounters()
Get number of counters |
void |
reset()
Reset counter to zero |
void |
setCounter(int t)
Set counter to a value. |
java.lang.String |
toString()
Return a string |
void |
up()
Increment counter by one |
int |
whatIsCounter()
Get counter value |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Counter()
public Counter(int max)
max
- maximum count numberMethod Detail |
---|
public void up()
public void down()
public void reset()
public void setCounter(int t)
t
- value to set counter topublic int whatIsCounter()
public static int nbrOfCounters()
public boolean equals(java.lang.Object rhs)
equals
in class java.lang.Object
rhs
- Object to compare to
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |