public abstract class AbstractForce extends java.lang.Object implements Force
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.Modifier | Constructor and Description |
---|---|
protected |
AbstractForce()
Creates a default abstract force set to
on . |
protected |
AbstractForce(boolean isOn)
Creates an abstract force with the given state.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected AbstractForce()
on
.protected AbstractForce(boolean isOn)
isOn
- The initial state of the force.public AbstractForce turnOff()
public AbstractForce turnOn()
public AbstractForce turnOn(boolean isOn)
public boolean isOn()