Class BondPotentialEnergy

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

public class BondPotentialEnergy extends EnergyTerm
Bond potential energy term using Bond instances.
Since:
1.0
Author:
Michael J. Schnieders
  • Constructor Details

    • BondPotentialEnergy

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

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

      public BondPotentialEnergy(String name, int forceGroup, List<Bond> bonds)
      Create a BondPotentialEnergy initialized with a list of bonds and force group.
      Parameters:
      name - Name for this term.
      forceGroup - Force group identifier.
      bonds - List of Bond instances to add (null-safe).
    • BondPotentialEnergy

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

    • getNumberOfTerms

      public int getNumberOfTerms()
      Get the number of terms in this potential energy term.
      Specified by:
      getNumberOfTerms in class EnergyTerm
      Returns:
      The number of terms, which is the same as the number of bonds.
    • getBondedTermsArray

      public BondedTerm[] getBondedTermsArray()
      Get an array of BondedTerms in this term.
      Specified by:
      getBondedTermsArray in class EnergyTerm
      Returns:
      Array of BondedTerms, which are actually Bonds in this case.
    • addBond

      public boolean addBond(Bond bond)
      Add a Bond to this term.
      Parameters:
      bond - Bond to add (ignored if null).
      Returns:
      true if the bond was added.
    • addBonds

      public boolean addBonds(Bond[] bonds)
      Add an array of Bonds to this term.
      Parameters:
      bonds - Array of Bond instances to add.
      Returns:
      true if the bonds were added.
    • addBonds

      public boolean addBonds(List<Bond> bonds)
      Add a list of Bonds to this term.
      Parameters:
      bonds - List of Bond instances to add.
      Returns:
      true if the bonds were added.
    • removeBond

      public boolean removeBond(Bond bond)
      Remove a Bond from this term.
      Parameters:
      bond - Bond to remove (ignored if null).
      Returns:
      true if the bond was present and removed.
    • getBond

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

      public List<Bond> getBonds()
      Get an unmodifiable view of the Bonds in this term.
      Returns:
      Unmodifiable List of Bonds.
    • getBondArray

      public Bond[] getBondArray()
      Get an array of Bonds in this term.
      Returns:
      Array of Bonds.
    • getNumberOfBonds

      public int getNumberOfBonds()
      Get the number of Bonds in this term.
      Returns:
      The number of Bonds.
    • getBondEnergyString

      public String getBondEnergyString()
    • log

      public void log()
      Log the details of Bond interactions.
      Specified by:
      log in class EnergyTerm
    • 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.