public abstract class Command
extends java.lang.Object
Command
abstract class has a concrete subclass corresponding to
each of the possible commands that can be issued by a client. The protocol specification contains
more information about the expected behavior of various commands.Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Returns
true if two Command s are equal; that is, they produce the same string
representation. |
java.lang.String |
getSender()
Gets the nickname of the client who issued the
Command . |
int |
getSenderId()
Gets the user ID of the client who issued the
Command . |
abstract Broadcast |
updateServerModel(ServerModel model)
Processes the command and updates the server model accordingly.
|
public int getSenderId()
Command
.public java.lang.String getSender()
Command
.public abstract Broadcast updateServerModel(ServerModel model)
model
- An instance of the ServerModelApi
class which represents the current
state of the server.Broadcast
object, informing clients about changes resulting from the
command.public boolean equals(java.lang.Object o)
true
if two Command
s are equal; that is, they produce the same string
representation.equals
in class java.lang.Object
o
- the object to compare with this
for equality