|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.util.ButtonCounter
public class ButtonCounter
This is class is for data entry using the NXT keyboard.
Counts number of presses of left and right buttons
Press ENTER together with together with LEFT or RIGHT to decrease the count.
Press ESCAPE to end counting.
Displays the count as it is entered, and makes a sound with each button press.
Stores the count in public fields
Field Summary | |
---|---|
int |
_leftCount
Output only not used in calculations; use after count() returns; |
int |
_rightCount
Output only not used in calculations ; use this value after count() returns; |
Constructor Summary | |
---|---|
ButtonCounter()
|
Method Summary | |
---|---|
void |
count()
called by count( string) |
void |
count(String s)
Start counting; parameter string is displayed; use it to identify this particular call returns when ESC or ENTER button is pressed Hold Enter and left or right to decrease count, otherwise it increases counters are reset when this method is called. |
void |
count(String s,
int left,
int right)
Initializes values of left count and right count. |
int |
getLeftCount()
Use this method after counting is complete; |
int |
getRightCount()
Use this method after counting is complete; |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int _rightCount
public int _leftCount
Constructor Detail |
---|
public ButtonCounter()
Method Detail |
---|
public int getRightCount()
public int getLeftCount()
public void count(String s)
public void count()
public void count(String s, int left, int right)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |