org.crwth.systems
Class Physics

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.crwth.systems.Physics
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
SimplePhysics1d

public abstract class Physics
extends Thread

A generic Physics class. Physics act upon Space, applying force on the Masses within, using the Springs attached.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Physics()
           
 
Method Summary
abstract  void applyForce(Mass m)
          Calculates the force applied on the Mass by all other Masses and Springs in the Space, and adds that force to the Mass.
abstract  void setSpace(Space s)
          Sets the Space object this object will act upon.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Physics

public Physics()
Method Detail

setSpace

public abstract void setSpace(Space s)
                       throws WrongDimensionException
Sets the Space object this object will act upon.

Parameters:
s - the Space object
Throws:
WrongDimensionException - if s has a mismatched dimension.

applyForce

public abstract void applyForce(Mass m)
                         throws WrongDimensionException
Calculates the force applied on the Mass by all other Masses and Springs in the Space, and adds that force to the Mass.

Parameters:
m - the Mass object to exert force upon.
Throws:
WrongDimensionException - if s has a mismatched dimension.