public abstract class TargetedForce extends AbstractForce
Force that has its subject Particles already specified, and hence does
not support the Force.apply(Particle) method. Users wishing to create custom
Forces of this kind should extend this class, implementing the Force.apply()
method only. Examples of this kind of Force are the TwoBodyForces Attraction
and Spring forces| Constructor and Description |
|---|
TargetedForce() |
| Modifier and Type | Method and Description |
|---|---|
Particle |
apply(Particle p)
This type of
Force does not support application to any Particle p;
an exception will be thrown by this method. |
isOff, isOn, turnOff, turnOn, turnOnpublic Particle apply(Particle p) throws java.lang.UnsupportedOperationException
Force does not support application to any Particle p;
an exception will be thrown by this method.p - irrelevant, this method will always throw an exceptionjava.lang.UnsupportedOperationException - this Force is guaranteed to throw this exception