org.jogre.common
Class User

java.lang.Object
  extended byjava.util.Observable
      extended byorg.jogre.common.User
All Implemented Interfaces:
ITransmittable

public class User
extends Observable
implements ITransmittable

Transmittable user data object. Contains the username and their rating (currently not implemented yet).

Version:
Alpha 0.2.1
Author:
Bob Marks

Field Summary
protected  int rating
          Rating of User.
protected  String username
          Username of User.
static String XML_NAME
          XML name.
 
Constructor Summary
User(String username, int rating)
          Constructor which takes a username and a rating.
User(XMLElement message)
          Constructor which creates a User object from the flatten () method of another User object.
 
Method Summary
 XMLElement flatten()
          Flatten the User object for transmission.
 int getRating()
          Returns the rating of this particular user (currently not implemented).
 String getUsername()
          Return the username of this user.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_NAME

public static final String XML_NAME
XML name.

See Also:
Constant Field Values

username

protected String username
Username of User.


rating

protected int rating
Rating of User.

Constructor Detail

User

public User(String username,
            int rating)
Constructor which takes a username and a rating.

Parameters:
username -
rating -

User

public User(XMLElement message)
     throws TransmissionException
Constructor which creates a User object from the flatten () method of another User object.

Parameters:
message - XMLElement communication object.
Throws:
TransmissionException - Thrown if there is a problem in transmission.
Method Detail

getUsername

public String getUsername()
Return the username of this user.

Returns:
username Username as a String.

getRating

public int getRating()
Returns the rating of this particular user (currently not implemented).

Returns:
rating Rating of user (int)

flatten

public XMLElement flatten()
Flatten the User object for transmission.

Specified by:
flatten in interface ITransmittable
Returns:
XML version of the state of an object which can be constructed again.
See Also:
ITransmittable.flatten()