|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.net.message.MID
An Message Identifier, which identifies a sender or recipient of a message. An optional nickname (defaults to name if not specified) may also be set.
A player is identified by having the Power attribute set. A non-player does not have the Power set.
No security is attempted here. It is up to the underlying Channel to ensure (by extending this class, if required) that MIDs are valid. Specifically, ensuring that Player MIDs cannot be faked by non-players or other players.
Field Summary | |
static MID |
ANONYMOUS
Anonymous sender (TODO: needs i18n) |
Constructor Summary | |
MID(Power power,
java.lang.String name)
Create an MID |
|
MID(java.lang.String nick,
java.lang.String name)
Create an MID |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Compare two MIDs for equality (of all fields) |
java.lang.String |
getName()
Get the name (which may be null) associated with the ID |
java.lang.String |
getNick()
Get the nickname. |
java.lang.String |
getNickAndName()
Prints nick, and if set, name. |
Power |
getPower()
Get the Power (or null, if unknown or not applicable) associated with the ID |
int |
hashCode()
Hashcode implementation |
boolean |
isPlayer()
Determine if this MID belongs to a player or not. |
java.lang.String |
toString()
Equivalent to getNickAndName() |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final MID ANONYMOUS
Constructor Detail |
public MID(java.lang.String nick, java.lang.String name)
public MID(Power power, java.lang.String name)
Method Detail |
public final Power getPower()
public java.lang.String getName()
public java.lang.String getNick()
public boolean isPlayer()
public java.lang.String getNickAndName()
public java.lang.String toString()
public boolean equals(java.lang.Object obj)
public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |