|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcourses.dsv2pvt.messageclasses.Msg
courses.dsv2pvt.messageclasses.Present
Used to inquire whether or not a client(s) is online or
not. The response is in form of a list of all ClientStatus
objects matching the inquiry.
The present message is sent to the server. The server searches
for matches and add the ClientStatus
object(s) of the
match(es) to the Present object and returns it to the client.
Constructor Summary | |
Present()
Creates a Present inquiry for all clients that are online. |
|
Present(String subject)
Creates a Present inquiry for one specific clients. |
Method Summary | |
void |
addMatch(ClientStatus clientStatus)
Add a match. |
void |
addMatches(Iterator iter)
Adds a collection of matches to the object. |
ClientStatus |
getMatch(int idx)
Returns the ClientStatus of the specified client. |
Iterator |
getMatches()
Returns an iterator to the collection of matches. |
String |
getSubject()
Returns the username of the subject of the inquiry. |
boolean |
isAll()
Returns true if the message is an inquiry of all online clients. |
int |
noMatches()
The number of matches of the inquiry. |
void |
setAll(boolean all)
Sets the status of the inquiry. |
Methods inherited from class courses.dsv2pvt.messageclasses.Msg |
getSender, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Present()
public Present(String subject)
subject
- the username of the clientMethod Detail |
public int noMatches()
public boolean isAll()
public String getSubject()
public void setAll(boolean all)
all
- true if all online clients, else false.public Iterator getMatches()
public ClientStatus getMatch(int idx)
ClientStatus
of the specified client.
idx
- an index (0 <= idx < getMatches())public void addMatches(Iterator iter) throws ClassCastException
iter
- an iterator to a collection of matches to be added.
ClassCastException
public void addMatch(ClientStatus clientStatus)
clientStatus
- the ClientStatus
of the match to add.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |