FileDocCategorySizeDatePackage
MudPerson.javaAPI DocExample2183Sat Jan 24 10:44:42 GMT 2004je3.rmi

MudPerson

public class MudPerson extends UnicastRemoteObject implements RemoteMudPerson
This is the simplest of the remote objects that we implement for the MUD. It maintains only a little bit of state, and has only two exported methods

Fields Summary
String
name
String
description
PrintWriter
tellStream
Constructors Summary
public MudPerson(String n, String d, PrintWriter out)

        name = n;
        description = d;
        tellStream = out;
    
Methods Summary
public java.lang.StringgetDescription()
A remote method that returns this person's description

	return description;
    
public java.lang.StringgetName()
Return the person's name. Not a remote method

 return name; 
public voidsetDescription(java.lang.String d)
Set the person's description. Not a remote method

 description = d; 
public voidsetName(java.lang.String n)
Set the person's name. Not a remote method

 name = n; 
public voidsetTellStream(java.io.PrintWriter out)
Set the stream that messages to us should be written to. Not remote.

 tellStream = out; 
public voidtell(java.lang.String message)
A remote method that delivers a message to the person. I.e. it delivers a message to the user controlling the "person"

        tellStream.println(message);
        tellStream.flush();