Package ffx.potential.bonded
Class BondedTerm
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
ffx.potential.bonded.MSNode
ffx.potential.bonded.BondedTerm
- All Implemented Interfaces:
BondedEnergy
,ROLS
,Serializable
,Cloneable
,Comparable<BondedTerm>
,MutableTreeNode
,TreeNode
- Direct Known Subclasses:
Angle
,AngleTorsion
,Bond
,ImproperTorsion
,OutOfPlaneBend
,PiOrbitalTorsion
,RestrainDistance
,RestrainPosition
,RestraintTorsion
,StretchBend
,StretchTorsion
,Torsion
,TorsionTorsion
,UreyBradley
The BondedTerm class is extended by all Valence Geometry classes (bond, angle, dihedral, torsion,
etc.).
- Since:
- 1.0
- Author:
- Michael J. Schnieders
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected Atom[]
Atoms that are used to form this term.protected Bond[]
Bonds that are used to form this term.protected double
Energy of the term (kcal/mol).protected String
ID of this BondedTerm.protected double
Value of the term (e.g. bond length, angle, dihedral angle, etc).Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
Fields inherited from interface ffx.potential.bonded.ROLS
MaxLengthScale
-
Constructor Summary
ConstructorDescriptionDefault ConstructorBondedTerm
(String i) Constructor which sets the Term's id. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if any atom of this BondedTerm has the Lambda flag set.int
boolean
containsHydrogenboolean
containsResolution
(Atom.Resolution resolution) Checks if at least one atom in this BondedTerm is of the given resolution.boolean
destroy()
destroyfinal boolean
getAtom
(int index) Get the constituent Atom specified by index.Atom[]
Returns all Atoms contained in this BondedTerm, regardless of whether they are child nodes in the tree structure.Atom[]
getAtomArray
(boolean returnCopy) Returns all Atoms contained in this BondedTerm, regardless of whether they are child nodes in the tree structure.Atom[]
getAtoms()
Returns a reference to the Atoms contained in this BondedTerm, regardless of whether they are child nodes in the tree structure.getBond
(int index) Get the constituent Bond specified by index.getID()
Get the Term's id.boolean
getUse()
This method returns true if any atom is being used.double
getValue()
Get the Term's value.int
hashCode()
boolean
Check if this BondedTerm is constrained.boolean
Check if this BondedTerm is lambda-sensitive (e.g., a softcore dihedral).boolean
This method returns true if any atom is marked as being part of a neural network.void
print()
Prints the MSNode's namestatic <T extends BondedTerm>
voidremoveNeuralNetworkTerms
(List<T> list) This method removes terms from a list that are marked as being part of a neural network.void
Add a constituent Atom to the Term.void
Add constituent Bonds to the Term.void
setColor
(RendererCache.ColorModel newColorModel, org.jogamp.vecmath.Color3f color, org.jogamp.java3d.Material mat) setColorvoid
Sets the Constraint on this bond (clearing it if null).void
Sets the Term's id.final void
setID_Key
(boolean reverse) setID_Keyvoid
setSelected
(boolean b) Setter for the fieldselected
.void
setValue
(double v) Sets the Term's value.void
setView
(RendererCache.ViewModel newViewModel, List<org.jogamp.java3d.BranchGroup> newShapes) setViewtoString()
Methods inherited from class ffx.potential.bonded.MSNode
contains, drawLabel, getAngleList, getAngleTorsionList, getAtomList, getAtomList, getBondList, getCenter, getChildList, getExtent, getImproperTorsionList, getList, getList, getMSCount, getMSNode, getMW, getName, getOutOfPlaneBendList, getPiOrbitalTorsionList, getStretchBendList, getStretchTorsionList, getTorsionList, getTorsionTorsionList, getTotalMass, getUreyBradleyList, isSelected, removeChild, setName, update
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ffx.potential.bonded.BondedEnergy
energy, energy, energy, update
-
Field Details
-
id
ID of this BondedTerm. -
atoms
Atoms that are used to form this term. -
bonds
Bonds that are used to form this term. -
value
protected double valueValue of the term (e.g. bond length, angle, dihedral angle, etc). -
energy
protected double energyEnergy of the term (kcal/mol).
-
-
Constructor Details
-
BondedTerm
public BondedTerm()Default Constructor -
BondedTerm
Constructor which sets the Term's id.- Parameters:
i
- aString
object.
-
-
Method Details
-
applyLambda
public boolean applyLambda()Check if any atom of this BondedTerm has the Lambda flag set.- Returns:
- True if Lambda is applied to one of the BondedTerm atoms.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<BondedTerm>
-
containsHydrogen
public boolean containsHydrogen()containsHydrogen- Returns:
- a boolean.
-
isNeuralNetwork
public boolean isNeuralNetwork()This method returns true if any atom is marked as being part of a neural network.- Returns:
- True if any atom is marked as being part of a neural network.
-
removeNeuralNetworkTerms
This method removes terms from a list that are marked as being part of a neural network.- Type Parameters:
T
- The Bonded term class.- Parameters:
list
- The list to check.
-
containsResolution
Checks if at least one atom in this BondedTerm is of the given resolution.- Parameters:
resolution
- aAtom.Resolution
object.- Returns:
- true if at least one atom in this term is of the specified resolution.
-
destroy
public boolean destroy()destroy -
equals
MSNode equality := same class and same name. Consider replacing with a Comparator<MSNode> for cases where non-reference equality is desired.
Overridden method that returns true if object is equals to this, is of the same Class and has the same id.
-
getAtom
Get the constituent Atom specified by index.- Parameters:
index
- The index of the Atom to return.- Returns:
- a
Atom
object.
-
getAtoms
Returns a reference to the Atoms contained in this BondedTerm, regardless of whether they are child nodes in the tree structure.- Returns:
- Atoms in this BondedTerm
-
getAtomArray
Returns all Atoms contained in this BondedTerm, regardless of whether they are child nodes in the tree structure. Returns a new array, not a reference to the original array.- Returns:
- Atoms in this BondedTerm
-
getAtomArray
Returns all Atoms contained in this BondedTerm, regardless of whether they are child nodes in the tree structure.- Parameters:
returnCopy
- If true, return a new copy of the Atom array.- Returns:
- Atoms in this BondedTerm
-
getBond
Get the constituent Bond specified by index.- Parameters:
index
- The index of the Bond to return.- Returns:
- a
Bond
object.
-
getID
Get the Term's id.- Returns:
- a
String
object.
-
getUse
public boolean getUse()This method returns true if any atom is being used.- Returns:
- True if any atom is being used.
-
setID
Sets the Term's id.- Parameters:
i
- aString
object.
-
getValue
public double getValue()Get the Term's value.- Returns:
- a double.
-
setValue
public void setValue(double v) Sets the Term's value.- Parameters:
v
- a double.
-
hashCode
public int hashCode() -
isConstrained
public boolean isConstrained()Check if this BondedTerm is constrained.- Returns:
- If constrained.
-
isLambdaScaled
public boolean isLambdaScaled()Check if this BondedTerm is lambda-sensitive (e.g., a softcore dihedral).- Returns:
- True if Lambda affects the energy of this term.
-
print
public void print()Prints the MSNode's namePrints the toString method to stdout
-
setAtoms
Add a constituent Atom to the Term.- Parameters:
a
- an array ofAtom
objects.
-
setBonds
Add constituent Bonds to the Term.- Parameters:
b
- an array ofBond
objects.
-
setColor
public void setColor(RendererCache.ColorModel newColorModel, org.jogamp.vecmath.Color3f color, org.jogamp.java3d.Material mat) setColor- Specified by:
setColor
in interfaceROLS
- Overrides:
setColor
in classMSNode
- Parameters:
newColorModel
- aRendererCache.ColorModel
object.color
- aColor3f
object.mat
- aMaterial
object.
-
setConstraint
Sets the Constraint on this bond (clearing it if null). May recursively set the Constraint on component terms (i.e. an Angle will call setConstraint on its component Bonds).- Parameters:
c
- Constraint or null to clear.
-
setID_Key
public final void setID_Key(boolean reverse) setID_Key- Parameters:
reverse
- a boolean.
-
setSelected
public void setSelected(boolean b) Setter for the fieldselected
.- Overrides:
setSelected
in classMSNode
- Parameters:
b
- a boolean.
-
setView
public void setView(RendererCache.ViewModel newViewModel, List<org.jogamp.java3d.BranchGroup> newShapes) setView -
toString
Overridden toString method returns the MSNode's name
Overridden toString Method returns the Term's id.
-