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,RestrainTorsion,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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Atom[]Atoms that are used to form this term.protected Bond[]Bonds that are used to form this term.protected doubleEnergy of the term (kcal/mol).protected StringID of this BondedTerm.protected doubleValue of the term (e.g. bond length, angle, dihedral angle, etc).Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObjectFields inherited from interface ffx.potential.bonded.ROLS
MaxLengthScale -
Constructor Summary
ConstructorsConstructorDescriptionDefault ConstructorBondedTerm(String i) Constructor which sets the Term's id. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if any atom of this BondedTerm has the Lambda flag set.intbooleancontainsHydrogenbooleancontainsResolution(Atom.Resolution resolution) Checks if at least one atom in this BondedTerm is of the given resolution.booleandestroy()destroyfinal booleangetAtom(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.booleangetUse()This method returns true if any atom is being used.doublegetValue()Get the Term's value.inthashCode()booleanCheck if this BondedTerm is constrained.booleanCheck if this BondedTerm is lambda-sensitive (e.g., a softcore dihedral).booleanThis method returns true if any atom is marked as being part of a neural network.voidprint()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.voidAdd a constituent Atom to the Term.voidAdd constituent Bonds to the Term.voidsetColor(RendererCache.ColorModel newColorModel, org.jogamp.vecmath.Color3f color, org.jogamp.java3d.Material mat) setColorvoidSets the Constraint on this bond (clearing it if null).voidSets the Term's id.final voidsetID_Key(boolean reverse) setID_KeyvoidsetSelected(boolean b) Setter for the fieldselected.voidsetValue(double v) Sets the Term's value.voidsetView(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, getFirstActiveHeavyAtom, getImproperTorsionList, getList, getList, getMSCount, getMSNode, getMW, getName, getOutOfPlaneBendList, getPiOrbitalTorsionList, getStretchBendList, getStretchTorsionList, getTorsionList, getTorsionTorsionList, getTotalMass, getUreyBradleyList, isSelected, removeChild, setName, updateMethods 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, setUserObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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- aStringobject.
-
-
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:
compareToin 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.Resolutionobject.- 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
Atomobject.
-
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
Bondobject.
-
getID
Get the Term's id.- Returns:
- a
Stringobject.
-
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- aStringobject.
-
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 ofAtomobjects.
-
setBonds
Add constituent Bonds to the Term.- Parameters:
b- an array ofBondobjects.
-
setColor
public void setColor(RendererCache.ColorModel newColorModel, org.jogamp.vecmath.Color3f color, org.jogamp.java3d.Material mat) setColor- Specified by:
setColorin interfaceROLS- Overrides:
setColorin classMSNode- Parameters:
newColorModel- aRendererCache.ColorModelobject.color- aColor3fobject.mat- aMaterialobject.
-
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:
setSelectedin 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.
-