org.gicentre.utils.network.traer.physics
Class AbstractForce

java.lang.Object
  extended by org.gicentre.utils.network.traer.physics.AbstractForce
All Implemented Interfaces:
Force
Direct Known Subclasses:
TargetedForce, UniversalForce

public abstract class AbstractForce
extends java.lang.Object
implements Force

A skeletal implementation of Force covering the methods concerned with the on/off state. For the typical user wishing to make a custom Force, it is best to extend this class (or one of the other skeletal implementations that meet the custom needs more specifically: TargetedForce, UniversalForce, or TwoBodyForce) and deal only with defining the Force.apply() and Force.apply(Particle) methods.

Since:
4.0
Author:
Carl Pearson, Jeffrey Traer Bernstein with Minor Modifications by Jo Wood.

Constructor Summary
protected AbstractForce()
          Creates a default abstract force set to on.
protected AbstractForce(boolean isOn)
          Creates an abstract force with the given state.
 
Method Summary
 boolean isOff()
          Reports whether or not the force is off.
 boolean isOn()
          Reports whether or not the force is on.
 AbstractForce turnOff()
          Turns the force off.
 AbstractForce turnOn()
          Turns the force on.
 AbstractForce turnOn(boolean isOn)
          Sets the force to the given state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.gicentre.utils.network.traer.physics.Force
apply, apply
 

Constructor Detail

AbstractForce

protected AbstractForce()
Creates a default abstract force set to on.


AbstractForce

protected AbstractForce(boolean isOn)
Creates an abstract force with the given state.

Parameters:
isOn - The initial state of the force.
Method Detail

turnOff

public AbstractForce turnOff()
Turns the force off.

Specified by:
turnOff in interface Force
Returns:
This force now in an 'off' state.

turnOn

public AbstractForce turnOn()
Turns the force on.

Specified by:
turnOn in interface Force
Returns:
This force now in an 'on' state.

turnOn

public AbstractForce turnOn(boolean isOn)
Sets the force to the given state.

Specified by:
turnOn in interface Force
Parameters:
isOn - Determins if this force is on or off.
Returns:
This force in its newly set state.

isOn

public boolean isOn()
Reports whether or not the force is on.

Specified by:
isOn in interface Force
Returns:
True if the force is on.

isOff

public boolean isOff()
Reports whether or not the force is off.

Specified by:
isOff in interface Force
Returns:
True if the force is off.


giCentre Utilities V.3.3, API documentation generated 6th April, 2013