org.gicentre.utils.network.traer.physics

## Class TargetedForce

- java.lang.Object
- - org.gicentre.utils.network.traer.physics.AbstractForce
  - - org.gicentre.utils.network.traer.physics.TargetedForce

- All Implemented Interfaces:
    Force
  Direct Known Subclasses:
    TwoBodyForce

      public abstract class TargetedForce
      extends AbstractForce

  A `Force` that has its subject `Particle`s 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 `TwoBodyForce`s `Attraction` and `Spring` forces
  Version:
    3.4, 5th February, 2016.
  Author:
    Carl Pearson and minor modifications by Jo Wood.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TargetedForce()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class org.gicentre.utils.network.traer.physics.AbstractForce

      `isOff, isOn, turnOff, turnOn, turnOn`

    - ### 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`

- - ### Constructor Detail

    - #### TargetedForce

          public TargetedForce()

  - ### Method Detail

    - #### apply

          public Particle apply(Particle p)
                         throws java.lang.UnsupportedOperationException

      This type of `Force` does not support application to any Particle p; an exception will be thrown by this method.
      Parameters:
        `p` - irrelevant, this method will always throw an exception
      Returns:
        irrelevant, this method will always throw an exception
      Throws:
        `java.lang.UnsupportedOperationException` - this Force is guaranteed to throw this exception