Class 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

public abstract class BondedTerm extends MSNode implements BondedEnergy, Comparable<BondedTerm>
The BondedTerm class is extended by all Valence Geometry classes (bond, angle, dihedral, torsion, etc.).
Since:
1.0
Author:
Michael J. Schnieders
See Also:
  • Field Details

    • id

      protected String id
      ID of this BondedTerm.
    • atoms

      protected Atom[] atoms
      Atoms that are used to form this term.
    • bonds

      protected Bond[] bonds
      Bonds that are used to form this term.
    • value

      protected double value
      Value of the term (e.g. bond length, angle, dihedral angle, etc).
    • energy

      protected double energy
      Energy of the term (kcal/mol).
  • Constructor Details

    • BondedTerm

      public BondedTerm()
      Default Constructor
    • BondedTerm

      public BondedTerm(String i)
      Constructor which sets the Term's id.
      Parameters:
      i - a String 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

      public int compareTo(BondedTerm t)
      Specified by:
      compareTo in interface Comparable<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

      public static <T extends BondedTerm> void removeNeuralNetworkTerms(List<T> list)
      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

      public boolean containsResolution(Atom.Resolution resolution)
      Checks if at least one atom in this BondedTerm is of the given resolution.
      Parameters:
      resolution - a Atom.Resolution object.
      Returns:
      true if at least one atom in this term is of the specified resolution.
    • destroy

      public boolean destroy()
      destroy
      Overrides:
      destroy in class MSNode
      Returns:
      a boolean.
    • equals

      public final boolean equals(Object object)

      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.

      Overrides:
      equals in class MSNode
    • getAtom

      public Atom getAtom(int index)
      Get the constituent Atom specified by index.
      Parameters:
      index - The index of the Atom to return.
      Returns:
      a Atom object.
    • getAtoms

      public Atom[] 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

      public Atom[] 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

      public Atom[] getAtomArray(boolean returnCopy)
      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

      public Bond getBond(int index)
      Get the constituent Bond specified by index.
      Parameters:
      index - The index of the Bond to return.
      Returns:
      a Bond object.
    • getID

      public String 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

      public void setID(String i)
      Sets the Term's id.
      Parameters:
      i - a String 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()
      Overrides:
      hashCode in class MSNode
    • 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 name

      Prints the toString method to stdout

      Overrides:
      print in class MSNode
    • setAtoms

      public void setAtoms(Atom[] a)
      Add a constituent Atom to the Term.
      Parameters:
      a - an array of Atom objects.
    • setBonds

      public void setBonds(Bond[] b)
      Add constituent Bonds to the Term.
      Parameters:
      b - an array of Bond objects.
    • setColor

      public void setColor(RendererCache.ColorModel newColorModel, org.jogamp.vecmath.Color3f color, org.jogamp.java3d.Material mat)
      setColor
      Specified by:
      setColor in interface ROLS
      Overrides:
      setColor in class MSNode
      Parameters:
      newColorModel - a RendererCache.ColorModel object.
      color - a Color3f object.
      mat - a Material object.
    • setConstraint

      public void setConstraint(Constraint c)
      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 field selected.
      Overrides:
      setSelected in class MSNode
      Parameters:
      b - a boolean.
    • setView

      public void setView(RendererCache.ViewModel newViewModel, List<org.jogamp.java3d.BranchGroup> newShapes)
      setView
      Specified by:
      setView in interface ROLS
      Overrides:
      setView in class MSNode
      Parameters:
      newViewModel - a RendererCache.ViewModel object.
      newShapes - a List object.
    • toString

      public String toString()

      Overridden toString method returns the MSNode's name

      Overridden toString Method returns the Term's id.

      Overrides:
      toString in class MSNode