igeo

## Class ISpring

- java.lang.Object
- - igeo.IDynamicsBase
  - - igeo.ISpring

- All Implemented Interfaces:
    IDynamics, ISpringI, ISubobject, ITensionI

      public class ISpring
      extends IDynamicsBase
      implements ISpringI

  Class of IDynamics to simulate spring force between two particles with specified length.
  Author:
    Satoru Sugihara

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `constantTension` if constantTension is true, amount of force is always constant and it's equals to tension.
    `double` | `length`
    `double` | `maxTension`
    `IParticleI` | `pt1`
    `IParticleI` | `pt2`
    `double` | `tension` tension is a coefficient to convert distance of two points to amount of force.

    - ### Fields inherited from class igeo.IDynamicsBase

      `parent, targets`

    - ### Fields inherited from interface igeo.ITensionI

      `defaultTension`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ISpring(IParticleI p1, IParticleI p2)`
    `ISpring(IParticleI p1, IParticleI p2, double tension)`
    `ISpring(IParticleI p1, IParticleI p2, double tension, double length)`
    `ISpring(IParticleI p1, IParticleI p2, double tension, double length, IObject parent)`
    `ISpring(IParticleI p1, IParticleI p2, double tension, IObject parent)`
    `ISpring(IParticleI p1, IParticleI p2, IObject parent)`
    `ISpring(IVecI p1, IVecI p2)`
    `ISpring(IVecI p1, IVecI p2, double tension)`
    `ISpring(IVecI p1, IVecI p2, double tension, double length)`
    `ISpring(IVecI p1, IVecI p2, double tension, double length, IObject parent)`
    `ISpring(IVecI p1, IVecI p2, double tension, IObject parent)`
    `ISpring(IVecI p1, IVecI p2, IObject parent)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `constant()` if constantTension is true, amount of force is always constant and it's equals to tension.
    `ISpring` | `constant(boolean cnst)` if constantTension is true, amount of force is always constant and it's equals to tension.
    `void` | `interact(java.util.ArrayList<IDynamics> dynamics)` behavior definition of interaction with other dynamic objects.
    `double` | `len()` get length
    `ISpring` | `len(double length)` set length
    `ISpring` | `len(IVecI p1, IVecI p2)` set length by two points
    `double` | `length()` alias of len
    `ISpring` | `length(double length)` alias of len
    `ISpring` | `length(IVecI p1, IVecI p2)` alias of len
    `double` | `maxTension()` if maxTension is set to be positive number, it limits the force (distance * tension) is cut off at maxTension.
    `ISpring` | `maxTension(double maxTension)` if maxTension is set to be positive number, it limits the force (distance * tension) is cut off at maxTension if constant is set, maxTension is ignored.
    `ISpring` | `parent(IObject par)` setting parent object
    `IParticleI` | `particle(int i)` alias of pt(int)
    `IParticleI` | `particle1()` alias of pt1()
    `IParticleI` | `particle2()` alias of pt2()
    `IVec` | `pos(int i)` position of particle(int i)
    `IVec` | `pos1()` position of particle1
    `IVec` | `pos2()` position of particle2
    `IParticleI` | `pt(int i)` getting end point.
    `IParticleI` | `pt1()` getting end point1.
    `IParticleI` | `pt2()` getting end point2.
    `ISpring` | `removeTarget(int i)` remove target object.
    `ISpring` | `removeTarget(IObject obj)` remove target object.
    `ISpring` | `target(IObject targetObj)` add terget object to be updated by this dynamic object.
    `double` | `tension()` tension is a coefficient to convert distance of two points to amount of force.
    `ISpring` | `tension(double tension)` tension is a coefficient to convert distance of two points to amount of force.

    - ### Methods inherited from class igeo.IDynamicsBase

      `initDynamicsBase, initDynamicsBase, initDynamicsBase, localDynamics, parent, postinteract, postupdate, preinteract, preupdate, target, targetNum, targets, update, updateTarget`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### pt1

          public IParticleI pt1

    - #### pt2

          public IParticleI pt2

    - #### tension

          public double tension

      tension is a coefficient to convert distance of two points to amount of force.

    - #### constantTension

          public boolean constantTension

      if constantTension is true, amount of force is always constant and it's equals to tension. Only direction of force changes. But if the distance is zero, force is also zero.

    - #### maxTension

          public double maxTension

    - #### length

          public double length

  - ### Constructor Detail

    - #### ISpring

          public ISpring(IParticleI p1,
                 IParticleI p2,
                 double tension,
                 double length,
                 IObject parent)

    - #### ISpring

          public ISpring(IVecI p1,
                 IVecI p2,
                 double tension,
                 double length,
                 IObject parent)

    - #### ISpring

          public ISpring(IParticleI p1,
                 IParticleI p2,
                 double tension,
                 IObject parent)

    - #### ISpring

          public ISpring(IVecI p1,
                 IVecI p2,
                 double tension,
                 IObject parent)

    - #### ISpring

          public ISpring(IParticleI p1,
                 IParticleI p2,
                 IObject parent)

    - #### ISpring

          public ISpring(IVecI p1,
                 IVecI p2,
                 IObject parent)

    - #### ISpring

          public ISpring(IParticleI p1,
                 IParticleI p2,
                 double tension,
                 double length)

    - #### ISpring

          public ISpring(IVecI p1,
                 IVecI p2,
                 double tension,
                 double length)

    - #### ISpring

          public ISpring(IParticleI p1,
                 IParticleI p2,
                 double tension)

    - #### ISpring

          public ISpring(IVecI p1,
                 IVecI p2,
                 double tension)

    - #### ISpring

          public ISpring(IParticleI p1,
                 IParticleI p2)

    - #### ISpring

          public ISpring(IVecI p1,
                 IVecI p2)

  - ### Method Detail

    - #### tension

          public double tension()

      Description copied from interface: `ITensionI`
      tension is a coefficient to convert distance of two points to amount of force.
      Specified by:
        `tension` in interface `ITensionI`

    - #### tension

          public ISpring tension(double tension)

      Description copied from interface: `ITensionI`
      tension is a coefficient to convert distance of two points to amount of force.
      Specified by:
        `tension` in interface `ITensionI`

    - #### constant

          public boolean constant()

      Description copied from interface: `ITensionI`
      if constantTension is true, amount of force is always constant and it's equals to tension. Only direction of force changes. But if the distance is zero, force is also zero.
      Specified by:
        `constant` in interface `ITensionI`

    - #### constant

          public ISpring constant(boolean cnst)

      Description copied from interface: `ITensionI`
      if constantTension is true, amount of force is always constant and it's equals to tension. Only direction of force changes. But if the distance is zero, force is also zero.
      Specified by:
        `constant` in interface `ITensionI`

    - #### maxTension

          public double maxTension()

      if maxTension is set to be positive number, it limits the force (distance * tension) is cut off at maxTension. if constant is set, maxTension is ignored.
      Specified by:
        `maxTension` in interface `ITensionI`

    - #### maxTension

          public ISpring maxTension(double maxTension)

      if maxTension is set to be positive number, it limits the force (distance * tension) is cut off at maxTension if constant is set, maxTension is ignored.
      Specified by:
        `maxTension` in interface `ITensionI`

    - #### len

          public double len()

      Description copied from interface: `ISpringI`
      get length
      Specified by:
        `len` in interface `ISpringI`

    - #### len

          public ISpring len(double length)

      Description copied from interface: `ISpringI`
      set length
      Specified by:
        `len` in interface `ISpringI`

    - #### len

          public ISpring len(IVecI p1,
                    IVecI p2)

      Description copied from interface: `ISpringI`
      set length by two points
      Specified by:
        `len` in interface `ISpringI`

    - #### length

          public double length()

      Description copied from interface: `ISpringI`
      alias of len
      Specified by:
        `length` in interface `ISpringI`

    - #### length

          public ISpring length(double length)

      Description copied from interface: `ISpringI`
      alias of len
      Specified by:
        `length` in interface `ISpringI`

    - #### length

          public ISpring length(IVecI p1,
                       IVecI p2)

      Description copied from interface: `ISpringI`
      alias of len
      Specified by:
        `length` in interface `ISpringI`

    - #### pt

          public IParticleI pt(int i)

      getting end point. i==0 or i==1. if i is other value, returns first point.
      Specified by:
        `pt` in interface `ITensionI`

    - #### particle

          public IParticleI particle(int i)

      alias of pt(int)
      Specified by:
        `particle` in interface `ITensionI`

    - #### pos

          public IVec pos(int i)

      position of particle(int i)
      Specified by:
        `pos` in interface `ITensionI`

    - #### pt1

          public IParticleI pt1()

      getting end point1.
      Specified by:
        `pt1` in interface `ITensionI`

    - #### particle1

          public IParticleI particle1()

      alias of pt1()
      Specified by:
        `particle1` in interface `ITensionI`

    - #### pos1

          public IVec pos1()

      position of particle1
      Specified by:
        `pos1` in interface `ITensionI`

    - #### pt2

          public IParticleI pt2()

      getting end point2.
      Specified by:
        `pt2` in interface `ITensionI`

    - #### particle2

          public IParticleI particle2()

      alias of pt2()
      Specified by:
        `particle2` in interface `ITensionI`

    - #### pos2

          public IVec pos2()

      position of particle2
      Specified by:
        `pos2` in interface `ITensionI`

    - #### parent

          public ISpring parent(IObject par)

      Description copied from interface: `ISubobject`
      setting parent object
      Specified by:
        `parent` in interface `ISubobject`
      Overrides:
        `parent` in class `IDynamicsBase`

    - #### target

          public ISpring target(IObject targetObj)

      Description copied from class: `IDynamicsBase`
      add terget object to be updated by this dynamic object.
      Specified by:
        `target` in interface `IDynamics`
      Overrides:
        `target` in class `IDynamicsBase`

    - #### removeTarget

          public ISpring removeTarget(int i)

      Description copied from class: `IDynamicsBase`
      remove target object.
      Specified by:
        `removeTarget` in interface `IDynamics`
      Overrides:
        `removeTarget` in class `IDynamicsBase`

    - #### removeTarget

          public ISpring removeTarget(IObject obj)

      Description copied from class: `IDynamicsBase`
      remove target object.
      Specified by:
        `removeTarget` in interface `IDynamics`
      Overrides:
        `removeTarget` in class `IDynamicsBase`

    - #### interact

          public void interact(java.util.ArrayList<IDynamics> dynamics)

      Description copied from class: `IDynamicsBase`
      behavior definition of interaction with other dynamic objects. The server puts all dynamic objects including itself.
      Specified by:
        `interact` in interface `IDynamics`
      Overrides:
        `interact` in class `IDynamicsBase`