Package org.openscience.cdk
Class LonePair
- java.lang.Object
-
- org.openscience.cdk.ChemObject
-
- org.openscience.cdk.ElectronContainer
-
- org.openscience.cdk.LonePair
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ICDKObject
,IChemObject
,IElectronContainer
,ILonePair
- Direct Known Subclasses:
DebugLonePair
public class LonePair extends ElectronContainer implements Serializable, ILonePair, Cloneable
A LonePair is an orbital primarily located with one Atom, containing two electrons.- See Also:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- data
- Keywords:
- orbital, lone-pair
-
-
Field Summary
Fields Modifier and Type Field Description protected IAtom
atom
The atom with which this lone pair is associated.protected int
electronCount
Number of electrons in the lone pair.-
Fields inherited from interface org.openscience.cdk.interfaces.IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITED
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Clones this LonePair object, including a clone of the atom for which the lone pair is defined.boolean
contains(IAtom atom)
Returns true if the given atom participates in this lone pair.IAtom
getAtom()
Returns the associated Atom.Integer
getElectronCount()
Returns the number of electrons in a LonePair.void
setAtom(IAtom atom)
Sets the associated Atom.String
toString()
Returns a one line string representation of this LonePair.-
Methods inherited from class org.openscience.cdk.ElectronContainer
setElectronCount
-
Methods inherited from class org.openscience.cdk.ChemObject
addListener, addProperties, clear, compare, flags, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, clear, flags, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, setFlag, setFlags, setID, setNotification, setProperties, setProperty
-
Methods inherited from interface org.openscience.cdk.interfaces.IElectronContainer
setElectronCount
-
-
-
-
Field Detail
-
electronCount
protected final int electronCount
Number of electrons in the lone pair.- See Also:
- Constant Field Values
-
atom
protected IAtom atom
The atom with which this lone pair is associated.
-
-
Constructor Detail
-
LonePair
public LonePair()
Constructs an unconnected lone pair.
-
LonePair
public LonePair(IAtom atom)
Constructs an lone pair on an Atom.- Parameters:
atom
- Atom to which this lone pair is connected
-
-
Method Detail
-
getElectronCount
public Integer getElectronCount()
Returns the number of electrons in a LonePair.- Specified by:
getElectronCount
in interfaceIElectronContainer
- Overrides:
getElectronCount
in classElectronContainer
- Returns:
- The number of electrons in a LonePair.
- See Also:
ElectronContainer.setElectronCount(java.lang.Integer)
-
getAtom
public IAtom getAtom()
Returns the associated Atom.- Specified by:
getAtom
in interfaceILonePair
- Returns:
- the associated Atom.
- See Also:
setAtom(org.openscience.cdk.interfaces.IAtom)
-
setAtom
public void setAtom(IAtom atom)
Sets the associated Atom.
-
contains
public boolean contains(IAtom atom)
Returns true if the given atom participates in this lone pair.
-
clone
public Object clone() throws CloneNotSupportedException
Clones this LonePair object, including a clone of the atom for which the lone pair is defined.- Specified by:
clone
in interfaceIChemObject
- Overrides:
clone
in classElectronContainer
- Returns:
- The cloned object
- Throws:
CloneNotSupportedException
- if the IChemObject cannot be cloned
-
toString
public String toString()
Returns a one line string representation of this LonePair. This method is conform RFC #9.- Specified by:
toString
in interfaceIChemObject
- Overrides:
toString
in classElectronContainer
- Returns:
- The string representation of this LonePair
-
-