net.algart.model3d.common.movement.model
Class Earth

java.lang.Object
  extended by net.algart.model3d.common.movement.model.Earth
All Implemented Interfaces:
Item

public final class Earth
extends java.lang.Object
implements Item

Earth planet: an item which acts to any other item, which have a mass, by EarthGravitationRule interaction. It is supposed that Earth attracts any item with the force, directed downward and equal to F=(0,0,−mg), where g is the parameter of this object: acceleration of gravity.

This class is not thread-safe, but is thread-compatible and can be synchronized manually if multithread access is necessary.

AlgART Laboratory 2010

Since:
JDK 1.5
Version:
1.0
Author:
Daniel Alievsky

Constructor Summary
Constructor and Description
Earth(double gravity)
          Creates new Earth with the specified acceleration of gravity g=gravity.
 
Method Summary
Modifier and Type Method and Description
 double getGravity()
          Returns the acceleration of gravity g.
 void setGravity(double gravity)
          Sets the acceleration of gravity g.
 java.lang.String toString()
          Returns a brief string description of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Earth

public Earth(double gravity)
Creates new Earth with the specified acceleration of gravity g=gravity.

Parameters:
gravity - acceleration of gravity g.
Method Detail

getGravity

public double getGravity()
Returns the acceleration of gravity g.

Returns:
the acceleration of gravity g.

setGravity

public void setGravity(double gravity)
Sets the acceleration of gravity g.

Parameters:
gravity - new acceleration of gravity g.

toString

public java.lang.String toString()
Returns a brief string description of this object.

The result of this method may depend on implementation.

Overrides:
toString in class java.lang.Object
Returns:
a brief string description of this object.