Class RestrainDistancePotentialEnergy

java.lang.Object
ffx.potential.terms.EnergyTerm
ffx.potential.terms.RestrainDistancePotentialEnergy

public class RestrainDistancePotentialEnergy extends EnergyTerm
Restrain-Distance potential energy term using RestrainDistance instances.
Since:
1.0
Author:
Michael J. Schnieders
  • Constructor Details

    • RestrainDistancePotentialEnergy

      public RestrainDistancePotentialEnergy(String name)
      Create a RestrainDistancePotentialEnergy with the provided name.
      Parameters:
      name - Name for this term.
    • RestrainDistancePotentialEnergy

      public RestrainDistancePotentialEnergy(String name, int forceGroup)
      Create a RestrainDistancePotentialEnergy with the provided name and force group.
      Parameters:
      name - Name for this term.
      forceGroup - Integer force group identifier.
    • RestrainDistancePotentialEnergy

      public RestrainDistancePotentialEnergy(String name, int forceGroup, List<RestrainDistance> restrainDistances)
      Create a RestrainDistancePotentialEnergy initialized with a list of terms and force group.
      Parameters:
      name - Name for this term.
      forceGroup - Force group identifier.
      restrainDistances - List of RestrainDistance instances (null-safe).
    • RestrainDistancePotentialEnergy

      public RestrainDistancePotentialEnergy(String name, Collection<RestrainDistance> restrainDistances)
      Create a RestrainDistancePotentialEnergy initialized with a collection of terms.
      Parameters:
      name - Name for this term (may be null).
      restrainDistances - Collection of RestrainDistance instances to add (null-safe).
  • Method Details

    • log

      public void log()
      Log the details of Restrain Distance interactions.
      Specified by:
      log in class EnergyTerm
    • getNumberOfTerms

      public int getNumberOfTerms()
      Get the number of BondedTerms in this term.
      Specified by:
      getNumberOfTerms in class EnergyTerm
      Returns:
      The number of BondedTerms.
    • getBondedTermsArray

      public BondedTerm[] getBondedTermsArray()
      Get an array of BondedTerms in this term.
      Specified by:
      getBondedTermsArray in class EnergyTerm
      Returns:
      Array of BondedTerms.
    • addRestrainDistance

      public boolean addRestrainDistance(RestrainDistance restrainDistance)
      Add a RestrainDistance to this term.
      Parameters:
      restrainDistance - RestrainDistance to add (ignored if null).
      Returns:
      true if it was added.
    • addRestrainDistances

      public boolean addRestrainDistances(RestrainDistance[] restrainDistances)
      Add an array of RestrainDistances to this term.
      Parameters:
      restrainDistances - Array of RestrainDistance instances to add.
      Returns:
      true if they were added.
    • addRestrainDistances

      public boolean addRestrainDistances(List<RestrainDistance> restrainDistances)
      Add a list of RestrainDistances to this term.
      Parameters:
      restrainDistances - List of RestrainDistance instances to add.
      Returns:
      true if they were added.
    • removeRestrainDistance

      public boolean removeRestrainDistance(RestrainDistance restrainDistance)
      Remove a RestrainDistance from this term.
      Parameters:
      restrainDistance - RestrainDistance to remove (ignored if null).
      Returns:
      true if it was present and removed.
    • getRestrainDistance

      public RestrainDistance getRestrainDistance(int index)
      Get the RestrainDistance at a given index.
      Parameters:
      index - Index in the internal list.
      Returns:
      RestrainDistance at the specified index.
      Throws:
      IndexOutOfBoundsException - if index is invalid.
    • getRestrainDistances

      public List<RestrainDistance> getRestrainDistances()
      Get an unmodifiable view of the RestrainDistances in this term.
      Returns:
      Unmodifiable List of RestrainDistances.
    • getRestrainDistanceArray

      public RestrainDistance[] getRestrainDistanceArray()
      Get an array of RestrainDistances in this term.
      Returns:
      Array of RestrainDistances.
    • getNumberOfRestrainDistances

      public int getNumberOfRestrainDistances()
      Get the number of RestrainDistances in this term.
      Returns:
      The number of RestrainDistances.
    • getRestrainDistances

      public List<RestrainDistance> getRestrainDistances(@Nullable BondType.BondFunction bondFunction)
      Returns a list of restraint distances filtered by the specified bond function. If the bondFunction is null, it returns all restrained bonds.
      Parameters:
      bondFunction - the type of bond function.
      Returns:
      a List object.
    • toPDBString

      public String toPDBString()
      Description copied from class: EnergyTerm
      Get a PDB-style REMARK representation of this energy term.
      Specified by:
      toPDBString in class EnergyTerm
      Returns:
      A PDB REMARK string for this energy term.
    • toString

      public String toString()
      Description copied from class: EnergyTerm
      Get a string representation of this energy term.
      Specified by:
      toString in class EnergyTerm
      Returns:
      A string representation of the energy term.