spellcast.model
Class Id

java.lang.Object
  extended by spellcast.model.Id
All Implemented Interfaces:
java.io.Serializable

public class Id
extends java.lang.Object
implements java.io.Serializable

An Id is used as an identifier for all model objects. It's purpose is to be used in other classes to identify the object instead of using a pointer to it. This reduces network traffic by sending Ids instead of the entire object.

An Id is an opaque object, classes just need to create one and only need to test for equality. There is no access to the internal fields.

Author:
Barrie Treloar
See Also:
Serialized Form

Field Summary
static Id EVERYONE
          This Id indicates that a message is for everyone.
static Id NO_ONE
          This Id indicates that a message is from no one.
static Id SPELLCAST
          This Id indicates that a message is from the game engine.
 
Method Summary
static Id createId()
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EVERYONE

public static final Id EVERYONE
This Id indicates that a message is for everyone.


SPELLCAST

public static final Id SPELLCAST
This Id indicates that a message is from the game engine.


NO_ONE

public static final Id NO_ONE
This Id indicates that a message is from no one. Also used by the client when the network has not yet established a connection.

Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

createId

public static Id createId()


Copyright © 2001-2005 Spellcast. All Rights Reserved.