jsim.animator
Class AnimationMessage

java.lang.Object
  extended by jsim.animator.AnimationMessage

public class AnimationMessage
extends java.lang.Object

This class implements a message which is passed from a Simulation to an Animation in the JSIM simulation package. A message specifies one of the operations defined in the Animator interface


Constructor Summary
AnimationMessage(int id, java.lang.Object[] parameters, double time, java.lang.String operation)
          Constructor for AnimationMessage
 
Method Summary
 int CompareTo(AnimationMessage am)
          This method compares 2 AnimationMessage objects to see which one has the most recent timestamp
 boolean equals(AnimationMessage am)
          This method Compares to AnimatiorMessages to determine if they are equivalent
 int getId()
           
 java.lang.String getOperation()
           
 java.lang.Object[] getParameters()
           
 double getTime()
           
 java.lang.String toString()
          Serializes this AnimationMessage for debugging purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnimationMessage

public AnimationMessage(int id,
                        java.lang.Object[] parameters,
                        double time,
                        java.lang.String operation)
Constructor for AnimationMessage

Parameters:
id - id of entity
parameters - other parameters for the command
time - timestamp for message
operation - operation to perform
Method Detail

CompareTo

public int CompareTo(AnimationMessage am)
This method compares 2 AnimationMessage objects to see which one has the most recent timestamp

Parameters:
am - The AnimationMessage to compare this to
Returns:
0 if equal, >0 if this is newer, <0 if this is older

equals

public boolean equals(AnimationMessage am)
This method Compares to AnimatiorMessages to determine if they are equivalent

Parameters:
am - The AnimationMessage to compare this to
Returns:
true if they are equivalent false otherwise

getId

public int getId()
Returns:
id of this AnimationMessage

getParameters

public java.lang.Object[] getParameters()
Returns:
parameters of this AnimationMessage

getTime

public double getTime()
Returns:
time of this AnimationMessage

getOperation

public java.lang.String getOperation()
Returns:
operation of this AnimationMessage

toString

public java.lang.String toString()
Serializes this AnimationMessage for debugging purposes

Overrides:
toString in class java.lang.Object
Returns:
String value for this AnimationMessage