|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Accumulator
Class to keep track of the state of an adding machine. It accumulates digits to form entire numbers and either adds or subtracts those numbers to a cumulative sum. It also has a reset option.
Constructor Summary | |
Accumulator()
|
Method Summary | |
void |
addDigit(int digit)
Adds the given digit to the end of the number currently being entered. |
void |
clear()
Resets the currently displayed and accumulated values to zero. |
int |
getDisplay()
Retrieves the value to be displayed. |
void |
minus()
Substracts the current number from the accumulated value. |
void |
plus()
Adds the current number to the accumulated value. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Accumulator()
Method Detail |
public void clear()
public void addDigit(int digit)
digit
- The digit to be appended to the end of the current number.public void plus()
public void minus()
public int getDisplay()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |