|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectthinkAlike.ThinkRequest
public class ThinkRequest
This class represents a session of the game ThinkAlike, it is created when a user wants to start a session, and when a user recieves a challange.
Constructor Summary | |
---|---|
ThinkRequest(ProgramControl pc,
java.lang.String to,
java.lang.String from,
java.lang.String pic,
java.lang.String thinkword)
Creates a new instance of ThinkRequest |
Method Summary | |
---|---|
java.lang.String |
calculateResult()
Simply checks if one of the three suggested word of the recipient matches the initial word and returns a string matching the result. |
void |
confirmRequest()
This method is called when the a ThinkRequest is recieved, showing a screen asking the user to confirm if he want the session or not. |
java.lang.String |
getFrom()
Returns the the address of the initiator fo the session |
java.lang.String |
getPic()
Returns the the picture assosiated with this session, as a text string in Base64 encoding |
java.lang.String |
getThinkWord()
Returns the the word that the initiator assosiated with the picture |
java.lang.String |
getTo()
Returns the the address of the recipient fo the session |
java.lang.String |
getWord1()
Return the first word suggested by the recipient |
java.lang.String |
getWord2()
Return the second word suggested by the recipient |
java.lang.String |
getWord3()
Return the third word suggested by the recipient |
boolean |
isInitiator()
Returns if this ThinkRequest object is acting as an initiator or not |
void |
isInitiator(boolean is)
Sets if this ThinkRequest object conatins the initiator or not (the other option is obviously the recipient) |
void |
makeEndForm()
On both part of the session this method generates the end form where the participans also can chat. |
void |
makeResultForm()
The session at the recipient, this method generates the form that show the result of her guessing. |
void |
recievedResponse(java.lang.String word1,
java.lang.String word2,
java.lang.String word3)
When recieveing an answer to the challenge, this message get the three words suggested and puts them on the screen of the initiator. |
void |
requestConfirmed()
deprecated |
void |
sendThinkRequest()
Sends the actual request using the Jxa object. |
void |
sendWords()
Used by the recipient to send the reply of the ThinkRequest to the initiator, using the Jxa object to send the three words. |
void |
setWords(java.lang.String word1,
java.lang.String word2,
java.lang.String word3)
Simple method to set the three words suggested by the recipient |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThinkRequest(ProgramControl pc, java.lang.String to, java.lang.String from, java.lang.String pic, java.lang.String thinkword)
pc
- pointer to the ProgramControl classto
- the address of the recipient of the initial sessionfrom
- the address of the initiator of the sessionpic
- a text representation of the picture, encoded in Base64thinkword
- the word the initator assosiates with the pictureMethod Detail |
---|
public void confirmRequest()
public void requestConfirmed()
public void sendThinkRequest() throws java.io.IOException
java.io.IOException
- On communication errors from the Jxa object.public void recievedResponse(java.lang.String word1, java.lang.String word2, java.lang.String word3)
word1
- first wordword2
- second wordword3
- third wordpublic void makeResultForm()
public void makeEndForm()
public java.lang.String calculateResult()
public void sendWords() throws java.io.IOException
java.io.IOException
- in case of communication error when using the Jxa objectpublic void isInitiator(boolean is)
is
- is true if it is the initiatorpublic boolean isInitiator()
public void setWords(java.lang.String word1, java.lang.String word2, java.lang.String word3)
word1
- first wordword2
- second wordword3
- third wordpublic java.lang.String getTo()
public java.lang.String getFrom()
public java.lang.String getPic()
public java.lang.String getThinkWord()
public java.lang.String getWord1()
public java.lang.String getWord2()
public java.lang.String getWord3()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |