|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--RingingPhone
Java class RingingPhone for testing a person. This has a response to step that is very simple. For 2 phone demo code for COM1204 OO Design Sp 2001
Constructor Summary | |
RingingPhone()
|
Method Summary | |
void |
dial()
In 2phones, there is no number to dial. There are a total of only two phones. |
void |
hangup()
Will effectively break the connection, so nothing said will be sent and nothing can be heard from the other user. |
java.lang.String |
listen()
Lets the person "hear" the current phone sound/message. |
static void |
main(java.lang.String[] args)
This test just loops on step to watch the phone change states in its predetermined way. |
void |
speak(java.lang.String say)
Lets the person "say" a phone sound/message to the phone. |
void |
step()
Primary simulation function to drive phone action. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RingingPhone()
Method Detail |
public static void main(java.lang.String[] args)
public void step()
public void dial()
public java.lang.String listen()
public void speak(java.lang.String say)
say
- A string representing what the person "says"
to the phone.public void hangup()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |