Package ffx.potential.terms
Class BondPotentialEnergy
java.lang.Object
ffx.potential.terms.EnergyTerm
ffx.potential.terms.BondPotentialEnergy
Bond potential energy term using
Bond
instances.- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Field Summary
Fields inherited from class ffx.potential.terms.EnergyTerm
energy, forceGroup, name
-
Constructor Summary
ConstructorsConstructorDescriptionBondPotentialEnergy
(String name) Create a BondPotentialEnergy with the provided name.BondPotentialEnergy
(String name, int forceGroup) Create a BondPotentialEnergy with the provided name and force group.BondPotentialEnergy
(String name, int forceGroup, List<Bond> bonds) Create a BondPotentialEnergy initialized with a list of bonds and force group.BondPotentialEnergy
(String name, Collection<Bond> bonds) Create a BondPotentialEnergy initialized with a collection of bonds. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a Bond to this term.boolean
Add an array of Bonds to this term.boolean
Add a list of Bonds to this term.getBond
(int index) Get the Bond at a given index.Bond[]
Get an array of Bonds in this term.Get an array of BondedTerms in this term.getBonds()
Get an unmodifiable view of the Bonds in this term.int
Get the number of Bonds in this term.int
Get the number of terms in this potential energy term.void
log()
Log the details of Bond interactions.boolean
removeBond
(Bond bond) Remove a Bond from this term.Get a PDB-style REMARK representation of this energy term.toString()
Get a string representation of this energy term.Methods inherited from class ffx.potential.terms.EnergyTerm
addAndGetEnergy, addAndGetRMSD, getEnergy, getForceGroup, getName, getRMSD, getTime, setEnergy, setForceGroup, setName, setRMSD, startTime, stopTime
-
Constructor Details
-
BondPotentialEnergy
Create a BondPotentialEnergy with the provided name.- Parameters:
name
- Name for this term.
-
BondPotentialEnergy
Create a BondPotentialEnergy with the provided name and force group.- Parameters:
name
- Name for this term.forceGroup
- Integer force group identifier.
-
BondPotentialEnergy
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
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 classEnergyTerm
- Returns:
- The number of terms, which is the same as the number of bonds.
-
getBondedTermsArray
Get an array of BondedTerms in this term.- Specified by:
getBondedTermsArray
in classEnergyTerm
- Returns:
- Array of BondedTerms, which are actually Bonds in this case.
-
addBond
Add a Bond to this term.- Parameters:
bond
- Bond to add (ignored if null).- Returns:
- true if the bond was added.
-
addBonds
Add an array of Bonds to this term.- Parameters:
bonds
- Array of Bond instances to add.- Returns:
- true if the bonds were added.
-
addBonds
Add a list of Bonds to this term.- Parameters:
bonds
- List of Bond instances to add.- Returns:
- true if the bonds were added.
-
removeBond
Remove a Bond from this term.- Parameters:
bond
- Bond to remove (ignored if null).- Returns:
- true if the bond was present and removed.
-
getBond
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
Get an unmodifiable view of the Bonds in this term.- Returns:
- Unmodifiable List of Bonds.
-
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
-
log
public void log()Log the details of Bond interactions.- Specified by:
log
in classEnergyTerm
-
toPDBString
Description copied from class:EnergyTerm
Get a PDB-style REMARK representation of this energy term.- Specified by:
toPDBString
in classEnergyTerm
- Returns:
- A PDB REMARK string for this energy term.
-
toString
Description copied from class:EnergyTerm
Get a string representation of this energy term.- Specified by:
toString
in classEnergyTerm
- Returns:
- A string representation of the energy term.
-