chemaxon.struc
Class MolBond

java.lang.Object
  extended by chemaxon.struc.MolBond
All Implemented Interfaces:
CEdge, StereoConstants, java.io.Serializable
Direct Known Subclasses:
QueryBond

public class MolBond
extends java.lang.Object
implements StereoConstants, java.io.Serializable, CEdge

Chemical bond.

Version:
5.3, 09/28/2009
Author:
Peter Csizmadia, Tamas Karpati, Andras Volford, Szilveszter Juhos, Erika Biro
See Also:
Serialized Form

Field Summary
static int ANY
          Any bond type.
static int AROMATIC
          Aromatic bond type.
static int ARROW
          Deprecated. As of Marvin 5.3
static int BOLD
          "Bold" attribute of the bond.
static double CCLENGTH
          Default bond length.
static int CONJUGATED
          Conjugation state of the bond.
static int COORDINATE
          Coordinate bond flag.
static int DOUBLE_OR_AROMATIC
          Double or aromatic query bond type.
static int DOWN
          Single bond down flag.
static int HASHED
          "Hashed" attribute of the bond.
static int RC_CHANGE
          The bond (order) has changed in the reaction.
static int RC_MAKE_AND_CHANGE
          The bond is created and changed.
static int RC_MAKE_OR_BREAK
          The bond is made or broken in the reaction.
static int RC_NOT_CENTER
          The bond is not a reacting center.
static int RC_NOT_MODIFIED
          The bond is not modified in the reaction.
static int RC_REACTING_CENTER
          The bond is a reacting center.
static int RC_UNMAPPED
          Unmapped bond in reacting center.
static int REACTING_CENTER_MASK
          Mask for reacting center bits.
static int SETSEQ_MAX
          Maximum bond set sequence number.
static int SETSEQ_OFF
          Bond set sequence number offset in flags.
static int SINGLE_OR_AROMATIC
          Single or aromatic query bond type.
static int SINGLE_OR_DOUBLE
          Single or double query bond type.
static int STEREO_MASK
          Single and double bond stereo mask.
static int STEREO1_MASK
          Single bond stereo mask.
static int STEREO2_CARE
          Cis/trans info of this bond is taken care of during the SSS process if this flag is set - used only for query bonds.
static int TOPOLOGY_CHAIN
          Bond is in a chain.
static int TOPOLOGY_MASK
          Bond topology mask.
static int TOPOLOGY_RING
          Bond is in a ring.
static int TYPE_MASK
          The lowest bits of the flags that store the bond type.
static int UP
          Single bond up flag.
static int WAVY
          Single bond wavy flag.
 
Fields inherited from interface chemaxon.struc.StereoConstants
ANTI, ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_M, CHIRALITY_MASK, CHIRALITY_P, CHIRALITY_r, CHIRALITY_R, CHIRALITY_s, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
 
Constructor Summary
  MolBond(MolAtom a1, MolAtom a2)
          Construct a single bond between two atoms.
  MolBond(MolAtom a1, MolAtom a2, int f)
          Construct a bond between two atoms.
protected MolBond(MolBond b)
          Copy constructor.
 
Method Summary
 int calcOrderFromLength()
          Calculate the bond order from the atomic distances.
 int calcOrderFromValence()
          Calculate bond order from the types and charges of the two atoms.
 int calcStereo2()
          Computes the stereochemistry of the bond based on the atomic coordinates.
 int calcStereo2(MolAtom atom1, MolAtom atom4)
          Computes the stereochemistry of the bond based on the atomic coordinates.
static int calcStereo2(MolAtom atom1, MolAtom atom2, MolAtom atom3, MolAtom atom4)
          Computes the stereochemistry of the atom sequence (scheme a1-a2=a3-a4) based on the atomic coordinates.
 void clearProperties()
          Removes all properties from this bond.
 java.lang.Object clone()
          Make a copy of this object.
 MolBond cloneBond(MolAtom a1, MolAtom a2)
          Clones this bond.
 MolBond cloneEdge(MolAtom a1, MolAtom a2)
          Deprecated. As of Marvin 5.3, replaced by cloneBond(MolAtom a1, MolAtom a2).
 boolean containsPropertyKey(java.lang.String key)
          Returns true if this bond has a mapping for the specified property key.
static double desiredLength(int atno1, int atno2, int type, int dim)
          Desired length of a bond between two atoms in Angstroms.
 boolean equals(java.lang.Object obj)
          Two bonds equal if their endpoints are the same.
 MolAtom getAtom1()
          Gets the first endpoint.
 MolAtom getAtom2()
          Gets the second endpoint.
 MolAtom getCTAtom1()
          Gets the first atom for cis/trans stereo calculation.
 MolAtom getCTAtom4()
          Gets the fourth atom for cis/trans stereo calculation.
 double getDesiredLength()
          Deprecated. use desiredLength(int, int, int, int) instead
 double getDesiredLength(boolean shortenHbonds)
          Deprecated. use desiredLength(int, int, int, int) instead
 int getFlags()
          Gets bond type (4 bits), stereo (2+2+1 bits), topology (2 bits), bond set (5 bits) and reacting center (7 bits) information.
 double getLength()
          Gets the actual length of the bond.
protected  java.lang.Object getLock()
          Gets lock object for synchronization.
 MolAtom getNode1()
          Deprecated. As of Marvin 5.3, replaced by getAtom1().
 MolAtom getNode2()
          Deprecated. As of Marvin 5.3, replaced by getAtom2().
 MolAtom getOtherAtom(MolAtom atom)
          Gets the other end of the bond.
 MolAtom getOtherNode(MolAtom node)
          Deprecated. As of Marvin 5.3, replaced by getOtherAtom(MolAtom).
 MoleculeGraph getParent()
          Gets the parent graph.
 java.lang.Object getProperty(java.lang.String key)
          Returns the property value to which the specified property key is mapped at this bond, or null if this bond has no mapping for this property key.
 java.lang.String getQuerystr()
          Gets the query properties.
 int getSetSeq()
          Gets the bond set.
 int getStereo1(MolAtom o)
          Gets wedge bond type relative to the specified chiral atom.
 int getType()
          Gets the bond type.
 boolean haveEqualProperties(MolBond b)
          Tests whether two bonds have the same properties.
 boolean isArrow()
          Deprecated. As of Marvin 5.3,
 boolean isBold()
          Decides whether this bond is bold or not.
 boolean isCollinear(MolAtom atom)
          Returns whether atom is collinear with the bond or not.
 boolean isConjugated()
          Gets the conjugation state of the bond set by the conjugation modul.
 boolean isCoordinate()
          Tests whether the bond is coordinate.
 boolean isCoordinative()
          Deprecated. As of Marvin 5.0, replaced by isCoordinate()
 boolean isHashed()
          Decides whether this bond is hashed or not.
 boolean isPositionVariation()
          Decides whether this bond is a position variation bond.
 boolean isQuery()
          Tests whether it is query bond or has query property: any single or double single or aromatic double or aromatic smarts bond ring or chain topology For more information on smarts bond and query bonds, see The JChem Query Guide
protected  boolean overridesAtMerge(MolBond e)
          Checks if this bond should override another one when two structures are merged.
 int propertyCount()
          Returns the number of property (property key - property value) mappings of this bond.
 java.util.Set<java.lang.String> propertyKeySet()
          Returns a set view of the property keys of this bond.
 java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> propertySet()
          Returns a set view of the properties (property key - property value mappings) of this bond.
 void putProperty(java.lang.String key, java.lang.Object value)
          Associates the specified value with the specified key at this bond.
 java.lang.Object removeProperty(java.lang.String key)
          Removes the mapping for this property key from this bond if present.
 void setFlags(int f)
          Sets bond type (4 bit), stereo (2+2+1 bit), topology (2 bit) bond set (5 bit) and reacting center (7 bits) information.
 void setFlags(int f, int mask)
          Sets bond type (3 bit), stereo (2+2+1 bit), and topology (2 bit) information.
 void setSetSeq(int g)
          Sets the bond set.
 void setStereo2Flags(MolAtom a1, MolAtom a4, int stereo2)
          Sets double bond stereo information.
 void setType(int t)
          Sets bond type and does valence checking for the endpoints.
 boolean stepWedge()
          Set the bond from 0 to UP or UP to DOWN.
static boolean stepWedge(MolBond[] bs)
          Flip the given bonds to the next state ONLY 1 bond is set to chiral starting from the last bond
 void swap()
          Change orientation.
 java.lang.String toString()
          Overrides Object.toString() to ease debugging.
 int transformCT(MolAtom a1, MolAtom a4, int f)
          Transform cis/trans stereo information into the `reference frame' of this bond.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CCLENGTH

public static final double CCLENGTH
Default bond length.

See Also:
Constant Field Values

ANY

public static final int ANY
Any bond type.

See Also:
Constant Field Values

TYPE_MASK

public static final int TYPE_MASK
The lowest bits of the flags that store the bond type.

See Also:
Constant Field Values

AROMATIC

public static final int AROMATIC
Aromatic bond type.

See Also:
Constant Field Values

SINGLE_OR_DOUBLE

public static final int SINGLE_OR_DOUBLE
Single or double query bond type.

See Also:
Constant Field Values

SINGLE_OR_AROMATIC

public static final int SINGLE_OR_AROMATIC
Single or aromatic query bond type.

See Also:
Constant Field Values

DOUBLE_OR_AROMATIC

public static final int DOUBLE_OR_AROMATIC
Double or aromatic query bond type.

See Also:
Constant Field Values

CONJUGATED

public static final int CONJUGATED
Conjugation state of the bond.

Since:
Marvin 4.1, 06/13/2006
See Also:
Constant Field Values

COORDINATE

public static final int COORDINATE
Coordinate bond flag.

Since:
Marvin 5.0, 12/04/2007
See Also:
Constant Field Values

UP

public static final int UP
Single bond up flag.

See Also:
Constant Field Values

DOWN

public static final int DOWN
Single bond down flag.

See Also:
Constant Field Values

WAVY

public static final int WAVY
Single bond wavy flag. It equals UP | DOWN.

Since:
Marvin 4.1
See Also:
UP, DOWN, Constant Field Values

STEREO1_MASK

public static final int STEREO1_MASK
Single bond stereo mask. It equals UP | DOWN.

See Also:
UP, DOWN, Constant Field Values

STEREO2_CARE

public static final int STEREO2_CARE
Cis/trans info of this bond is taken care of during the SSS process if this flag is set - used only for query bonds.

See Also:
STEREO_MASK, Constant Field Values

STEREO_MASK

public static final int STEREO_MASK
Single and double bond stereo mask. It equals STEREO1_MASK | CTUMASK | STEREO2_CARE.

See Also:
STEREO1_MASK, StereoConstants.CTUMASK, STEREO2_CARE, Constant Field Values

TOPOLOGY_RING

public static final int TOPOLOGY_RING
Bond is in a ring.

See Also:
TOPOLOGY_MASK, Constant Field Values

TOPOLOGY_CHAIN

public static final int TOPOLOGY_CHAIN
Bond is in a chain.

See Also:
TOPOLOGY_MASK, Constant Field Values

TOPOLOGY_MASK

public static final int TOPOLOGY_MASK
Bond topology mask. It equals TOPOLOGY_CHAIN | TOPOLOGY_RING

See Also:
TOPOLOGY_CHAIN, TOPOLOGY_RING, Constant Field Values

RC_REACTING_CENTER

public static final int RC_REACTING_CENTER
The bond is a reacting center.

Since:
Marvin 4.1
See Also:
REACTING_CENTER_MASK, Constant Field Values

RC_MAKE_OR_BREAK

public static final int RC_MAKE_OR_BREAK
The bond is made or broken in the reaction.

Since:
Marvin 4.1
See Also:
REACTING_CENTER_MASK, Constant Field Values

RC_CHANGE

public static final int RC_CHANGE
The bond (order) has changed in the reaction.

Since:
Marvin 4.1
See Also:
REACTING_CENTER_MASK, Constant Field Values

RC_MAKE_AND_CHANGE

public static final int RC_MAKE_AND_CHANGE
The bond is created and changed.

Since:
Marvin 4.1
See Also:
REACTING_CENTER_MASK, Constant Field Values

RC_NOT_CENTER

public static final int RC_NOT_CENTER
The bond is not a reacting center. This is an additional ChemDraw feature (value 15 in RXN file).

Since:
Marvin 4.1
See Also:
REACTING_CENTER_MASK, Constant Field Values

RC_NOT_MODIFIED

public static final int RC_NOT_MODIFIED
The bond is not modified in the reaction.

Since:
Marvin 4.1
See Also:
REACTING_CENTER_MASK, Constant Field Values

RC_UNMAPPED

public static final int RC_UNMAPPED
Unmapped bond in reacting center. This is a ChemDraw feature that is not represented in neither standard nor ChemDraw generated RXN files (likely only in .cdx)

Since:
Marvin 4.1
See Also:
REACTING_CENTER_MASK, Constant Field Values

REACTING_CENTER_MASK

public static final int REACTING_CENTER_MASK
Mask for reacting center bits.

Since:
Marvin 4.1
See Also:
Constant Field Values

SETSEQ_OFF

public static final int SETSEQ_OFF
Bond set sequence number offset in flags.

Since:
Marvin 3.3
See Also:
SETSEQ_MAX, Constant Field Values

SETSEQ_MAX

public static final int SETSEQ_MAX
Maximum bond set sequence number.

Since:
Marvin 3.3
See Also:
SETSEQ_OFF, Constant Field Values

ARROW

public static final int ARROW
Deprecated. As of Marvin 5.3
Reaction arrow flag.

See Also:
Constant Field Values

BOLD

public static final int BOLD
"Bold" attribute of the bond. Recognized only for single and double bonds

See Also:
Constant Field Values

HASHED

public static final int HASHED
"Hashed" attribute of the bond.

See Also:
Constant Field Values
Constructor Detail

MolBond

public MolBond(MolAtom a1,
               MolAtom a2,
               int f)
Construct a bond between two atoms.

Parameters:
a1 - the first atom
a2 - the second atom
f - bond type and other flags

MolBond

protected MolBond(MolBond b)
Copy constructor.

Parameters:
b - the original bond
Since:
3.5.2, 12/15/2004

MolBond

public MolBond(MolAtom a1,
               MolAtom a2)
Construct a single bond between two atoms.

Parameters:
a1 - the first atom
a2 - the second atom
Method Detail

getParent

public final MoleculeGraph getParent()
Gets the parent graph.

Returns:
the parent graph

swap

public void swap()
Change orientation.


getAtom1

public MolAtom getAtom1()
Gets the first endpoint.

Returns:
the first endpoint

getAtom2

public MolAtom getAtom2()
Gets the second endpoint.

Returns:
the second endpoint

getOtherAtom

public final MolAtom getOtherAtom(MolAtom atom)
Gets the other end of the bond.

Parameters:
atom - one of the bond endpoints
Returns:
the other endpoint
Since:
Marvin 3.0

getLength

public final double getLength()
Gets the actual length of the bond.

Returns:
the distance between the two atoms

getFlags

public final int getFlags()
Gets bond type (4 bits), stereo (2+2+1 bits), topology (2 bits), bond set (5 bits) and reacting center (7 bits) information.

Returns:
the flags
See Also:
TYPE_MASK, STEREO_MASK, TOPOLOGY_MASK, SETSEQ_OFF, REACTING_CENTER_MASK

setFlags

public void setFlags(int f)
Sets bond type (4 bit), stereo (2+2+1 bit), topology (2 bit) bond set (5 bit) and reacting center (7 bits) information. Bond type can be set by calling
 b.setFlags((b.getFlags() & ~MolBond.TYPE_MASK) | type);
 
Valence checking is omitted if you set the bond type this way, without setType.

Parameters:
f - the flags
Since:
Marvin 2.5
See Also:
TYPE_MASK, STEREO_MASK, TOPOLOGY_MASK, SETSEQ_OFF, REACTING_CENTER_MASK, setType(int)

setFlags

public void setFlags(int f,
                     int mask)
Sets bond type (3 bit), stereo (2+2+1 bit), and topology (2 bit) information. Bond type can be set by calling
 b.setFlags(type, MolBond.TYPE_MASK);
 
Valence checking is omitted if you set the bond type this way, without setType.

Parameters:
f - new value of the specified bits
mask - bits to set
See Also:
TYPE_MASK, STEREO_MASK, TOPOLOGY_MASK, setFlags(int), setType(int)

getType

public final int getType()
Gets the bond type. Possible values: 1 (single), 2 (double), 3 (triple), aromatic, coordinate, conjugated and query bond types.

Returns:
the bond type
See Also:
AROMATIC, SINGLE_OR_DOUBLE, SINGLE_OR_AROMATIC, DOUBLE_OR_AROMATIC, COORDINATE, CONJUGATED, ANY

setType

public void setType(int t)
Sets bond type and does valence checking for the endpoints.

Parameters:
t - the new bond type
See Also:
getType()

getSetSeq

public final int getSetSeq()
Gets the bond set.

Returns:
a number between 0 and SETSEQ_MAX
Since:
Marvin 3.3

setSetSeq

public final void setSetSeq(int g)
Sets the bond set.

Parameters:
g - a number between 0 and SETSEQ_MAX
Since:
Marvin 3.3

isConjugated

public final boolean isConjugated()
Gets the conjugation state of the bond set by the conjugation modul.

Returns:
true if the bond is a member of a conjugated system, false otherwise
Since:
Marvin 4.1, 06/13/2006

isCoordinative

public final boolean isCoordinative()
Deprecated. As of Marvin 5.0, replaced by isCoordinate()

Tests whether the bond is coordinative.

Returns:
true if it is coordinative bond, false otherwise
Since:
Marvin 4.1, 06/13/2006

isCoordinate

public final boolean isCoordinate()
Tests whether the bond is coordinate.

Returns:
true if it is coordinate bond, false otherwise
Since:
Marvin 5.0, 12/04/2007

isPositionVariation

public final boolean isPositionVariation()
Decides whether this bond is a position variation bond.

Returns:
true if this is a position variation bond, false otherwise
Since:
Marvin 5.3, 01/05/2010

isArrow

public final boolean isArrow()
Deprecated. As of Marvin 5.3,

Tests if this bond represents a reaction arrow or not.

Returns:
true if this bond represents a reaction arrow, false otherwise
Since:
Marvin 2.9, 08/06/2001
See Also:
ARROW

isBold

public final boolean isBold()
Decides whether this bond is bold or not.

Returns:
true if this bond is bold, false otherwise
Since:
Marvin 5.3, 09/24/2009
See Also:
BOLD

isHashed

public final boolean isHashed()
Decides whether this bond is hashed or not.

Returns:
true if this bond is hashed, false otherwise
Since:
Marvin 5.7
See Also:
HASHED

calcOrderFromLength

public int calcOrderFromLength()
Calculate the bond order from the atomic distances. The returned value should only be considered as an approximation.

Returns:
the bond order

calcOrderFromValence

public final int calcOrderFromValence()
Calculate bond order from the types and charges of the two atoms.

Returns:
the bond order

cloneBond

public MolBond cloneBond(MolAtom a1,
                         MolAtom a2)
Clones this bond.

Parameters:
a1 - new end atom 1
a2 - new end atom 2
Returns:
the clone
Since:
Marvin 4.1, 09/22/2005

clone

public java.lang.Object clone()
Make a copy of this object.

Overrides:
clone in class java.lang.Object
Returns:
the clone

getDesiredLength

public double getDesiredLength()
Deprecated. use desiredLength(int, int, int, int) instead

Desired length of a bond between two atoms in Angstroms. Works only for bonds in a molecule.

Returns:
the desired length

getDesiredLength

public double getDesiredLength(boolean shortenHbonds)
Deprecated. use desiredLength(int, int, int, int) instead

Desired length of a bond between two atoms in Angstroms. Works only for bonds in a molecule.

Parameters:
shortenHbonds - use 1.0 as bond length for explicit H bonds in 2D.
Returns:
the desired length

desiredLength

public static double desiredLength(int atno1,
                                   int atno2,
                                   int type,
                                   int dim)
Desired length of a bond between two atoms in Angstroms.

Parameters:
atno1 - atomic number of the first atom
atno2 - atomic number of the second atom
type - bond order
dim - space dimension, 2 or 3
Returns:
the desired length

getStereo1

public final int getStereo1(MolAtom o)
Gets wedge bond type relative to the specified chiral atom.

Parameters:
o - the chiral atom
Returns:
the wedge bond type or zero
See Also:
UP, DOWN, STEREO1_MASK, getFlags()

getCTAtom1

public final MolAtom getCTAtom1()
Gets the first atom for cis/trans stereo calculation.

Returns:
atom a1 from a1-a2=a3-a4, or null in other configurations
See Also:
calcStereo2()

getCTAtom4

public final MolAtom getCTAtom4()
Gets the fourth atom for cis/trans stereo calculation.

Returns:
atom a4 from a1-a2=a3-a4, or null in other configurations
See Also:
calcStereo2()

setStereo2Flags

public void setStereo2Flags(MolAtom a1,
                            MolAtom a4,
                            int stereo2)
Sets double bond stereo information. Normally invoked by the SMILES import process.

Parameters:
a1 - atom number 1 in scheme a1-a2=a3-a4
a4 - atom number 4
stereo2 - CIS/TRANS information
See Also:
StereoConstants.CIS, StereoConstants.TRANS, StereoConstants.CTUNSPEC, StereoConstants.CTUMASK, calcStereo2(MolAtom, MolAtom)

transformCT

public int transformCT(MolAtom a1,
                       MolAtom a4,
                       int f)
Transform cis/trans stereo information into the `reference frame' of this bond. a1 == null and/or a4 == null is also accepted, null corresponds to any neighbor of a2 or a4 that is different than the reference atoms (the first ligands).

Parameters:
a1 - atom connected to atom1
a4 - atom connected to atom2
f - original flags
Returns:
the transformed flags

calcStereo2

public int calcStereo2()
Computes the stereochemistry of the bond based on the atomic coordinates. Note that this member function does not change the stereo flags. Bond type is not checked.

Returns:
0, CIS, TRANS, or CIS|TRANS
See Also:
StereoConstants, getCTAtom1(), getCTAtom4(), calcStereo2(MolAtom, MolAtom)

calcStereo2

public int calcStereo2(MolAtom atom1,
                       MolAtom atom4)
Computes the stereochemistry of the bond based on the atomic coordinates. Note that this member function does not change the stereo flags. Bond type and connectivity are not checked (thus being bound to this bond is not a requirement for atoms a1 and a4).

Parameters:
atom1 - atom number 1 in scheme a1-a2=a3-a4
atom4 - atom number 4
Returns:
0, CIS, TRANS, or CIS|TRANS
See Also:
StereoConstants

calcStereo2

public static int calcStereo2(MolAtom atom1,
                              MolAtom atom2,
                              MolAtom atom3,
                              MolAtom atom4)
Computes the stereochemistry of the atom sequence (scheme a1-a2=a3-a4) based on the atomic coordinates. Note that this member function does not change any stereo flags. Connectivity are not checked.

Parameters:
atom1 - atom number 1 in scheme a1-a2=a3-a4
atom2 - atom number 2 in scheme a1-a2=a3-a4
atom3 - atom number 3 in scheme a1-a2=a3-a4
atom4 - atom number 4 in scheme a1-a2=a3-a4
Returns:
0, CIS, TRANS, or CIS|TRANS
See Also:
StereoConstants

stepWedge

public boolean stepWedge()
Set the bond from 0 to UP or UP to DOWN.

Returns:
true if the initial state was 0 or UP, false after DOWN.

stepWedge

public static boolean stepWedge(MolBond[] bs)
Flip the given bonds to the next state ONLY 1 bond is set to chiral starting from the last bond

Parameters:
bs - bond array which elements can be flipped
Returns:
true if flipping can be continued, false after last step

getQuerystr

public java.lang.String getQuerystr()
Gets the query properties.

Returns:
the query string
Since:
Marvin 3.4

haveEqualProperties

public boolean haveEqualProperties(MolBond b)
Tests whether two bonds have the same properties. Two bonds have equal properties if their flags are equal.

Returns:
true if they have the same properties, false otherwise
Since:
Marvin 3.4.1, 07/06/2004

overridesAtMerge

protected boolean overridesAtMerge(MolBond e)
Checks if this bond should override another one when two structures are merged. Aromatic bonds override non-aromatic bonds, higher order bonds override lower order bonds.

Parameters:
e - the other bond
Returns:
true if it overrides e, false otherwise
Since:
Marvin 3.5, 09/30/2004

isQuery

public final boolean isQuery()
Tests whether it is query bond or has query property: For more information on smarts bond and query bonds, see The JChem Query Guide

Returns:
true if the bond has a query bond type or property, false otherwise
Since:
Marvin 3.4
See Also:
ANY, SINGLE_OR_DOUBLE, SINGLE_OR_AROMATIC, DOUBLE_OR_AROMATIC, TOPOLOGY_MASK, TOPOLOGY_CHAIN, TOPOLOGY_RING

isCollinear

public boolean isCollinear(MolAtom atom)
Returns whether atom is collinear with the bond or not. (Calculates from coordinates.)

Parameters:
atom - Atom to decide about.
Returns:
true if atom and the atoms of the bond lie on the same line
Since:
Marvin 4.0 12/16/2004

getLock

protected final java.lang.Object getLock()
Gets lock object for synchronization.

Returns:
reference to the top parent graph

equals

public final boolean equals(java.lang.Object obj)
Two bonds equal if their endpoints are the same.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the other object
Returns:
true if the other object is a MolBond and equals this object, false otherwise

toString

public java.lang.String toString()
Overrides Object.toString() to ease debugging.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object
Since:
Marvin 5.0 12/10/2007

getNode1

public final MolAtom getNode1()
Deprecated. As of Marvin 5.3, replaced by getAtom1().


getNode2

public final MolAtom getNode2()
Deprecated. As of Marvin 5.3, replaced by getAtom2().


getOtherNode

public final MolAtom getOtherNode(MolAtom node)
Deprecated. As of Marvin 5.3, replaced by getOtherAtom(MolAtom).


cloneEdge

public final MolBond cloneEdge(MolAtom a1,
                               MolAtom a2)
Deprecated. As of Marvin 5.3, replaced by cloneBond(MolAtom a1, MolAtom a2).


propertySet

public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> propertySet()
Returns a set view of the properties (property key - property value mappings) of this bond. Each element in the returned set is a Map.Entry. Changes to the properties are reflected in the set, and vice-versa. The set supports element removal, which removes the corresponding property from this, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

Returns:
set view of the properties of this bond.
Since:
Marvin 5.10

propertyKeySet

public java.util.Set<java.lang.String> propertyKeySet()
Returns a set view of the property keys of this bond. Changes to the properties of this bond are reflected in the set, and vice-versa. The set supports element removal, which removes the corresponding property from this atom, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

Returns:
set view of the property keys of this bond.
Since:
Marvin 5.10

containsPropertyKey

public boolean containsPropertyKey(java.lang.String key)
Returns true if this bond has a mapping for the specified property key.

Parameters:
key - the property key which is to be searched for.
Returns:
true if this map contains a mapping for the specified property key.
Since:
Marvin 5.10

removeProperty

public java.lang.Object removeProperty(java.lang.String key)
Removes the mapping for this property key from this bond if present.

Parameters:
key - property key whose mapping is to be removed from the bond.
Returns:
previous poperty value associated with specified property key, or null if there was no mapping for property key. A null return can also indicate that the property mapping previously associated null with the specified property key.
Since:
Marvin 5.10

propertyCount

public int propertyCount()
Returns the number of property (property key - property value) mappings of this bond.

Returns:
the number of property mappings of this bond.
Since:
Marvin 5.10

getProperty

public java.lang.Object getProperty(java.lang.String key)
Returns the property value to which the specified property key is mapped at this bond, or null if this bond has no mapping for this property key. A return value of null does not necessarily indicate that the bond has no mapping for the property key; it is also possible that the bond explicitly maps the property key to null. The containsKey method may be used to distinguish these two cases.

Parameters:
key - the property key whose associated property value is to be returned.
Returns:
the property value to which this bond maps the specified property key, or null if the bond has no mapping for this property key.
Since:
Marvin 5.10

putProperty

public void putProperty(java.lang.String key,
                        java.lang.Object value)
Associates the specified value with the specified key at this bond. If this bond previously had a mapping for this property key, the old property value is replaced.

Parameters:
key - property key with which the specified value is to be associated.
value - property value to be associated with the specified property key.
Since:
Marvin 5.10

clearProperties

public void clearProperties()
Removes all properties from this bond.

Since:
Marvin 5.10