gravsphcolldemo
Class EntityBrData

java.lang.Object
  |
  +--gravsphcolldemo.EntityBrData

public class EntityBrData
extends java.lang.Object

This class stores information needed to construct an ArrayBlockReader defining an Entity for a simulation in Applet2. It is used to transfer information between Applet2 and EditEntityDialog.

Version:
27-Apr-2001
Author:
Miklos Reiter

Constructor Summary
EntityBrData()
          Constructs a new EntityBrData object without initializing any of its data members.
EntityBrData(java.lang.String aName, java.lang.String aMass, java.lang.String aRadius, java.lang.String aPosition, java.lang.String aVelocity, java.lang.String aColor)
          Constructs a new EntityBrData object from the given data by calling the setXXXX methods.
 
Method Summary
 void assertValid()
          Asserts that the data stored is complete (i.e.
 ArrayBlockReader getArrayBlockReader(java.lang.String[] projLawNames, int projLawNum)
          First calls assertValid() and then returns an ArrayBlockReader representing the Entity this EntityBrData object represents.
 java.lang.String getColor()
          Gets the Color.
 java.lang.String getMass()
          Returns the mass.
 java.lang.String getName()
          Returns the name.
 java.lang.String getPosition()
          Returns the position.
 java.lang.String getRadius()
          Returns the radius.
 java.lang.String getVelocity()
          Gets the velocity.
 void setColor(java.lang.String aColor)
          Sets the Color.
 void setMass(java.lang.String aMass)
          Sets the mass.
 void setName(java.lang.String aName)
          Sets the name.
 void setPosition(java.lang.String aPosition)
          Sets the position.
 void setRadius(java.lang.String aRadius)
          Sets the radius.
 void setVelocity(java.lang.String aVelocity)
          Sets the velocity.
 java.lang.String toString()
          Returns a String representation of the data that can be used, for example, to store this object in an AWT List.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityBrData

public EntityBrData()
Constructs a new EntityBrData object without initializing any of its data members.

EntityBrData

public EntityBrData(java.lang.String aName,
                    java.lang.String aMass,
                    java.lang.String aRadius,
                    java.lang.String aPosition,
                    java.lang.String aVelocity,
                    java.lang.String aColor)
             throws java.lang.IllegalArgumentException
Constructs a new EntityBrData object from the given data by calling the setXXXX methods.
Method Detail

getName

public java.lang.String getName()
Returns the name.

setName

public void setName(java.lang.String aName)
Sets the name.

getMass

public java.lang.String getMass()
Returns the mass.

setMass

public void setMass(java.lang.String aMass)
             throws java.lang.IllegalArgumentException
Sets the mass.

getRadius

public java.lang.String getRadius()
Returns the radius.

setRadius

public void setRadius(java.lang.String aRadius)
               throws java.lang.IllegalArgumentException
Sets the radius.

getPosition

public java.lang.String getPosition()
Returns the position.

setPosition

public void setPosition(java.lang.String aPosition)
                 throws java.lang.IllegalArgumentException
Sets the position.

getVelocity

public java.lang.String getVelocity()
Gets the velocity.

setVelocity

public void setVelocity(java.lang.String aVelocity)
                 throws java.lang.IllegalArgumentException
Sets the velocity.

getColor

public java.lang.String getColor()
Gets the Color.

setColor

public void setColor(java.lang.String aColor)
              throws java.lang.IllegalArgumentException
Sets the Color.

assertValid

public void assertValid()
                 throws java.lang.IllegalArgumentException
Asserts that the data stored is complete (i.e. everything has been set).

toString

public java.lang.String toString()
                          throws java.lang.IllegalArgumentException
Returns a String representation of the data that can be used, for example, to store this object in an AWT List.
Overrides:
toString in class java.lang.Object

getArrayBlockReader

public ArrayBlockReader getArrayBlockReader(java.lang.String[] projLawNames,
                                            int projLawNum)
                                     throws java.lang.IllegalArgumentException
First calls assertValid() and then returns an ArrayBlockReader representing the Entity this EntityBrData object represents.