|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfeud.clientserver.ServerEntry
A ServerEntry is a simple wrapper class for server related information. It's mainly used by the ServerBrowser.
Field Summary | |
int |
TIMEOUT
Default timeout for this entry. |
Constructor Summary | |
ServerEntry(java.lang.String name,
java.net.InetAddress addr,
int port,
int clients)
Creates a new ServerEntry |
Method Summary | |
int |
compareTo(java.lang.Object obj)
|
boolean |
equals(java.lang.Object obj)
|
java.net.InetAddress |
getAddress()
Returns the server's address. |
int |
getClientCount()
Returns the number of clients that the server has. |
java.lang.String |
getName()
Returns the name of the server. |
int |
getPort()
Returns the port on which the server is running. |
int |
hashCode()
|
boolean |
isConnected()
Do we have an connection to the server of this entry? |
boolean |
isOld()
Is the server entry "old"? |
void |
setClientCount(int cnt)
Sets the number of clients. |
void |
setConnected(boolean con)
Sets this entry to "connected". |
void |
touch()
"Touches" this entry, i.e. isOld will return false after doing this. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public final int TIMEOUT
Constructor Detail |
public ServerEntry(java.lang.String name, java.net.InetAddress addr, int port, int clients)
name
- the name of the server. This is not the address but any name like "Peter's server" or something.addr
- the address of the serverport
- the port of the serverclients
- the number of clients currently connected to that serverMethod Detail |
public java.lang.String getName()
public java.net.InetAddress getAddress()
public void setConnected(boolean con)
con
- boolean do we have an connection to this server or not?public boolean isConnected()
public int getPort()
public int getClientCount()
public void setClientCount(int cnt)
cnt
- the client countpublic void touch()
public boolean isOld()
public boolean equals(java.lang.Object obj)
public int hashCode()
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |