Package org.openscience.cdk
Class SingleElectron
- java.lang.Object
-
- org.openscience.cdk.ChemObject
-
- org.openscience.cdk.ElectronContainer
-
- org.openscience.cdk.SingleElectron
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ICDKObject
,IChemObject
,IElectronContainer
,ISingleElectron
- Direct Known Subclasses:
DebugSingleElectron
public class SingleElectron extends ElectronContainer implements Serializable, ISingleElectron, Cloneable
A Single Electron is an orbital which is occupied by only one electron. A radical in CDK is represented by an AtomContainer that contains an Atom and a SingleElectron type ElectronContainer:AtomContainer radical = new AtomContainer(); Atom carbon = new Atom("C"); carbon.setImplicitHydrogens(3); radical.addElectronContainer(new SingleElectron(carbon));
- See Also:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- data
- Keywords:
- radical, electron, unpaired
-
-
Field Summary
Fields Modifier and Type Field Description protected IAtom
atom
The atom with which this single electron is associated.protected int
electronCount
Number of electron for this class is defined as one.-
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
-
-
Constructor Summary
Constructors Constructor Description SingleElectron()
Constructs an single electron orbital with an associated Atom.SingleElectron(IAtom atom)
Constructs an single electron orbital on an Atom.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Clones this SingleElectron object, including a clone of the atom for which the SingleElectron is defined.boolean
contains(IAtom atom)
Returns true if the given atom participates in this SingleElectron.IAtom
getAtom()
Returns the associated Atom.Integer
getElectronCount()
Returns the number of electrons in this SingleElectron.void
setAtom(IAtom atom)
Sets the associated Atom.String
toString()
Returns a one line string representation of this SingleElectron.-
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 electron for this class is defined as one.- See Also:
- Constant Field Values
-
atom
protected IAtom atom
The atom with which this single electron is associated.
-
-
Constructor Detail
-
SingleElectron
public SingleElectron(IAtom atom)
Constructs an single electron orbital on an Atom.- Parameters:
atom
- The atom to which the single electron belongs.
-
SingleElectron
public SingleElectron()
Constructs an single electron orbital with an associated Atom.
-
-
Method Detail
-
getElectronCount
public Integer getElectronCount()
Returns the number of electrons in this SingleElectron.- Specified by:
getElectronCount
in interfaceIElectronContainer
- Overrides:
getElectronCount
in classElectronContainer
- Returns:
- The number of electrons in this SingleElectron.
- See Also:
ElectronContainer.setElectronCount(java.lang.Integer)
-
getAtom
public IAtom getAtom()
Returns the associated Atom.- Specified by:
getAtom
in interfaceISingleElectron
- Returns:
- the associated Atom.
- See Also:
setAtom(org.openscience.cdk.interfaces.IAtom)
-
setAtom
public void setAtom(IAtom atom)
Sets the associated Atom.- Specified by:
setAtom
in interfaceISingleElectron
- Parameters:
atom
- the Atom this SingleElectron will be associated with- See Also:
getAtom()
-
contains
public boolean contains(IAtom atom)
Returns true if the given atom participates in this SingleElectron.- Specified by:
contains
in interfaceISingleElectron
- Parameters:
atom
- The atom to be tested if it participates in this bond- Returns:
- true if this SingleElectron is associated with the atom
-
toString
public String toString()
Returns a one line string representation of this SingleElectron. This method is conform RFC #9.- Specified by:
toString
in interfaceIChemObject
- Overrides:
toString
in classElectronContainer
- Returns:
- The string representation of this SingleElectron
-
clone
public Object clone() throws CloneNotSupportedException
Clones this SingleElectron object, including a clone of the atom for which the SingleElectron is defined.- Specified by:
clone
in interfaceIChemObject
- Overrides:
clone
in classElectronContainer
- Returns:
- The cloned object
- Throws:
CloneNotSupportedException
- if the IChemObject cannot be cloned
-
-