Class BondManipulator
java.lang.Object
org.openscience.cdk.tools.manipulator.BondManipulator
Class with convenience methods that provide methods to manipulate
AtomContainer's. For example:
AtomContainerManipulator.replaceAtomByAtom(container, atom1, atom2);will replace the Atom in the AtomContainer, but in all the ElectronContainer's it participates too.
- Author:
- Egon Willighagen
- Source code:
- main
- Belongs to CDK module:
- core
- Created on:
- 2003-08-07
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IBond.Order
createBondOrder
(double bondOrder) Convenience method to convert a double into an IBond.Order.static void
decreaseBondOrder
(IBond bond) Decrease the order of a bond.static IBond.Order
decreaseBondOrder
(IBond.Order oldOrder) Returns the IBond.Order one lower.static double
destroyBondOrder
(IBond.Order bondOrder) Deprecated.static IAtom[]
getAtomArray
(IBond container) Constructs an array of Atom objects from Bond.static IBond.Order
getMaximumBondOrder
(Iterator<IBond> bonds) Returns the maximum bond order for a List of bonds, given an iterator to the list.static IBond.Order
getMaximumBondOrder
(List<IBond> bonds) Returns the maximum bond order for a List of bonds.static IBond.Order
getMaximumBondOrder
(IBond.Order firstOrder, IBond.Order secondOrder) Returns the maximum bond order for the two bond orders.static IBond.Order
getMaximumBondOrder
(IBond firstBond, IBond secondBond) Returns the maximum bond order for the two bonds.static IBond.Order
getMinimumBondOrder
(Iterator<IBond> bonds) Returns the minimum bond order for a List of bonds, given an iterator to the list.static IBond.Order
getMinimumBondOrder
(List<IBond> bonds) Returns the minimum bond order for a List of bonds.static int
getSingleBondEquivalentSum
(Iterator<IBond> bonds) Get the single bond equivalent (SBE) of a list of bonds, given an iterator to the list.static int
getSingleBondEquivalentSum
(List<IBond> bonds) Get the single bond equivalent (SBE) of a list of bonds.static void
increaseBondOrder
(IBond bond) Increment the bond order of this bond.static IBond.Order
increaseBondOrder
(IBond.Order oldOrder) Returns the IBond.Order one higher.static boolean
isHigherOrder
(IBond.Order first, IBond.Order second) Returns true if the first bond has a higher bond order than the second bond.static boolean
isLowerOrder
(IBond.Order first, IBond.Order second) Returns true if the first bond has a lower bond order than the second bond.
-
Constructor Details
-
BondManipulator
public BondManipulator()
-
-
Method Details
-
getAtomArray
Constructs an array of Atom objects from Bond.- Parameters:
container
- The Bond object.- Returns:
- The array of Atom objects.
-
isLowerOrder
Returns true if the first bond has a lower bond order than the second bond. It returns false if the bond order is equal, and if the order of the first bond is larger than that of the second. Also returns false if either bond order is unset.- Parameters:
first
- The first bond order objectsecond
- The second bond order object- Returns:
- true if the first bond order is lower than the second one, false otherwise
- See Also:
-
isHigherOrder
Returns true if the first bond has a higher bond order than the second bond. It returns false if the bond order is equal, and if the order of the first bond is lower than that of the second. Also returns false if either bond order is unset.- Parameters:
first
- The first bond order objectsecond
- The second bond order object- Returns:
- true if the first bond order is higher than the second one, false otherwise
- See Also:
-
increaseBondOrder
Returns the IBond.Order one higher. Does not increase the bond order beyond the QUADRUPLE bond order.- Parameters:
oldOrder
- the old order- Returns:
- The incremented bond order
- See Also:
-
increaseBondOrder
Increment the bond order of this bond.- Parameters:
bond
- The bond whose order is to be incremented- See Also:
-
decreaseBondOrder
Returns the IBond.Order one lower. Does not decrease the bond order lower the QUADRUPLE bond order.- Parameters:
oldOrder
- the old order- Returns:
- the decremented order
- See Also:
-
decreaseBondOrder
Decrease the order of a bond.- Parameters:
bond
- The bond in question- See Also:
-
createBondOrder
Convenience method to convert a double into an IBond.Order. Returns NULL if the bond order is not 1.0, 2.0, 3.0 and 4.0.- Parameters:
bondOrder
- The numerical bond order- Returns:
- An instance of
IBond.Order
- See Also:
-
destroyBondOrder
Deprecated.useIBond.Order.numeric().doubleValue()
insteadConvert aIBond.Order
to a numeric value. Single, double, triple and quadruple bonds are converted to 1.0, 2.0, 3.0 and 4.0 respectively.- Parameters:
bondOrder
- The bond order object- Returns:
- The numeric value
- See Also:
-
getMaximumBondOrder
Returns the maximum bond order for a List of bonds.- Parameters:
bonds
- The list of bonds to search through- Returns:
- The maximum bond order found
- See Also:
-
getMaximumBondOrder
Returns the maximum bond order for a List of bonds, given an iterator to the list.- Parameters:
bonds
- An iterator for the list of bonds- Returns:
- The maximum bond order found
- See Also:
-
getMaximumBondOrder
Returns the maximum bond order for the two bonds.- Parameters:
firstBond
- first bond to comparesecondBond
- second bond to compare- Returns:
- The maximum bond order found
-
getMaximumBondOrder
Returns the maximum bond order for the two bond orders.- Parameters:
firstOrder
- first bond order to comparesecondOrder
- second bond order to compare- Returns:
- The maximum bond order found
-
getMinimumBondOrder
Returns the minimum bond order for a List of bonds.- Parameters:
bonds
- The list of bonds to search through- Returns:
- The maximum bond order found
- See Also:
-
getMinimumBondOrder
Returns the minimum bond order for a List of bonds, given an iterator to the list.- Parameters:
bonds
- An iterator for the list of bonds- Returns:
- The minimum bond order found
- See Also:
-
getSingleBondEquivalentSum
Get the single bond equivalent (SBE) of a list of bonds. This sums the bond orders of all the bonds.- Parameters:
bonds
- The list of bonds- Returns:
- The SBE sum
- See Also:
-
getSingleBondEquivalentSum
Get the single bond equivalent (SBE) of a list of bonds, given an iterator to the list.- Parameters:
bonds
- An iterator to the list of bonds- Returns:
- The SBE sum
-
IBond.Order.numeric().doubleValue()
instead