public class Telephone extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.Scanner |
scanner |
| Constructor and Description |
|---|
Telephone(java.util.Scanner aScanner)
Construct phone object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
run(Connection c)
Loops reading user input and passes the input to the
Connection object's methods dial, record or hangup.
|
void |
speak(java.lang.String output)
Speak a message to System.out.
|
private java.util.Scanner scanner
public Telephone(java.util.Scanner aScanner)
aScanner - that reads text from a character-input streampublic void speak(java.lang.String output)
output - the text that will be "spoken"public void run(Connection c)
c - the connection that connects this phone to the
voice mail system