Package org.openscience.cdk.silent
Class Strand
- java.lang.Object
-
- org.openscience.cdk.silent.ChemObject
-
- org.openscience.cdk.silent.AtomContainer
-
- org.openscience.cdk.silent.Strand
-
- All Implemented Interfaces:
Serializable
,Cloneable
,IAtomContainer
,ICDKObject
,IChemObject
,IChemObjectListener
,IStrand
public class Strand extends AtomContainer implements Serializable, IStrand
A Strand is an AtomContainer which stores additional strand specific informations for a group of Atoms.- Author:
- Martin Eklund <martin.eklund@farmbio.uu.se>, Ola Spjuth <ola.spjuth@farmbio.uu.se>
- See Also:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- silent
- Created on:
- 2004-12-20
-
-
Field Summary
-
Fields inherited from class org.openscience.cdk.silent.AtomContainer
atomCount, atoms, bondCount, bonds, growArraySize, lonePairCount, lonePairs, singleElectronCount, singleElectrons, stereoElements
-
-
Constructor Summary
Constructors Constructor Description Strand()
Constructs a new Strand.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAtom(IAtom oAtom)
Adds the atom oAtom without specifying a Monomer or a Strand.void
addAtom(IAtom oAtom, IMonomer oMonomer)
Adds the atom oAtom to a specific Monomer.IStrand
clone()
Clones thisIChemObject
.IMonomer
getMonomer(String cName)
Retrieves a Monomer object by specifying its name.int
getMonomerCount()
Returns the number of monomers present in the Strand.Collection<String>
getMonomerNames()
Returns a collection of the names of allMonomer
s in this polymer.Map<String,IMonomer>
getMonomers()
Returns a hashtable containing the monomers in the strand.String
getStrandName()
Retrieves the strand name.String
getStrandType()
Retrieves the strand type.void
removeMonomer(String name)
Removes a particular monomer, specified by its name.void
setStrandName(String cStrandName)
Sets the name of the Strand object.void
setStrandType(String cStrandType)
Sets the type of the Strand object.String
toString()
Returns a one line description of this IChemObject.-
Methods inherited from class org.openscience.cdk.silent.AtomContainer
add, addBond, addBond, addBond, addElectronContainer, addLonePair, addLonePair, addSingleElectron, addSingleElectron, addStereoElement, atoms, bonds, contains, contains, contains, contains, contains, electronContainers, getAtom, getAtomCount, getAtomNumber, getBond, getBond, getBondCount, getBondNumber, getBondNumber, getBondOrderSum, getConnectedAtomsCount, getConnectedAtomsList, getConnectedBondsCount, getConnectedBondsCount, getConnectedBondsList, getConnectedElectronContainersList, getConnectedLonePairsCount, getConnectedLonePairsList, getConnectedSingleElectronsCount, getConnectedSingleElectronsList, getElectronContainer, getElectronContainerCount, getFirstAtom, getLastAtom, getLonePair, getLonePairCount, getLonePairNumber, getMaximumBondOrder, getMinimumBondOrder, getSingleElectron, getSingleElectronCount, getSingleElectronNumber, getTitle, indexOf, indexOf, indexOf, indexOf, isEmpty, lonePairs, remove, removeAllBonds, removeAllElectronContainers, removeAllElements, removeAtom, removeAtom, removeAtomAndConnectedElectronContainers, removeAtomOnly, removeAtomOnly, removeBond, removeBond, removeBond, removeElectronContainer, removeElectronContainer, removeLonePair, removeLonePair, removeSingleElectron, removeSingleElectron, setAtom, setAtoms, setBonds, setStereoElements, setTitle, singleElectrons, stateChanged, stereoElements
-
Methods inherited from class org.openscience.cdk.silent.ChemObject
addListener, addProperties, compare, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, 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.IAtomContainer
add, addBond, addBond, addBond, addElectronContainer, addLonePair, addLonePair, addSingleElectron, addSingleElectron, addStereoElement, atoms, bonds, contains, contains, contains, contains, contains, electronContainers, getAtom, getAtomCount, getAtomNumber, getBond, getBond, getBondCount, getBondNumber, getBondNumber, getBondOrderSum, getConnectedAtomsCount, getConnectedAtomsList, getConnectedBondsCount, getConnectedBondsCount, getConnectedBondsList, getConnectedElectronContainersList, getConnectedLonePairsCount, getConnectedLonePairsList, getConnectedSingleElectronsCount, getConnectedSingleElectronsList, getElectronContainer, getElectronContainerCount, getFirstAtom, getLastAtom, getLonePair, getLonePairCount, getLonePairNumber, getMaximumBondOrder, getMinimumBondOrder, getSingleElectron, getSingleElectronCount, getSingleElectronNumber, getTitle, indexOf, indexOf, indexOf, indexOf, isEmpty, lonePairs, remove, removeAllBonds, removeAllElectronContainers, removeAllElements, removeAtom, removeAtom, removeAtomAndConnectedElectronContainers, removeAtomOnly, removeAtomOnly, removeBond, removeBond, removeBond, removeElectronContainer, removeElectronContainer, removeLonePair, removeLonePair, removeSingleElectron, removeSingleElectron, setAtom, setAtoms, setBonds, setStereoElements, setTitle, singleElectrons, stereoElements
-
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObjectListener
stateChanged
-
-
-
-
Method Detail
-
getStrandName
public String getStrandName()
Retrieves the strand name.- Specified by:
getStrandName
in interfaceIStrand
- Returns:
- The name of the Strand object
- See Also:
setStrandName(java.lang.String)
-
getStrandType
public String getStrandType()
Retrieves the strand type.- Specified by:
getStrandType
in interfaceIStrand
- Returns:
- The type of the Strand object
- See Also:
setStrandType(java.lang.String)
-
setStrandName
public void setStrandName(String cStrandName)
Sets the name of the Strand object.- Specified by:
setStrandName
in interfaceIStrand
- Parameters:
cStrandName
- The new name for this strand- See Also:
getStrandName()
-
setStrandType
public void setStrandType(String cStrandType)
Sets the type of the Strand object.- Specified by:
setStrandType
in interfaceIStrand
- Parameters:
cStrandType
- The new type for this strand- See Also:
getStrandType()
-
addAtom
public void addAtom(IAtom oAtom)
Adds the atom oAtom without specifying a Monomer or a Strand. Therefore the atom gets added to a Monomer of type UNKNOWN in a Strand of type UNKNOWN.- Specified by:
addAtom
in interfaceIAtomContainer
- Specified by:
addAtom
in interfaceIStrand
- Overrides:
addAtom
in classAtomContainer
- Parameters:
oAtom
- The atom to add
-
addAtom
public void addAtom(IAtom oAtom, IMonomer oMonomer)
Adds the atom oAtom to a specific Monomer.
-
getMonomerCount
public int getMonomerCount()
Returns the number of monomers present in the Strand.- Specified by:
getMonomerCount
in interfaceIStrand
- Returns:
- number of monomers
-
getMonomer
public IMonomer getMonomer(String cName)
Retrieves a Monomer object by specifying its name.- Specified by:
getMonomer
in interfaceIStrand
- Parameters:
cName
- The name of the monomer to look for- Returns:
- The Monomer object which was asked for
-
getMonomerNames
public Collection<String> getMonomerNames()
Returns a collection of the names of allMonomer
s in this polymer.- Specified by:
getMonomerNames
in interfaceIStrand
- Returns:
- a
Collection
of all the monomer names.
-
removeMonomer
public void removeMonomer(String name)
Removes a particular monomer, specified by its name.- Specified by:
removeMonomer
in interfaceIStrand
- Parameters:
name
- The name of the monomer to remove
-
getMonomers
public Map<String,IMonomer> getMonomers()
Returns a hashtable containing the monomers in the strand.- Specified by:
getMonomers
in interfaceIStrand
- Returns:
- hashtable containing the monomers in the strand.
-
toString
public String toString()
Description copied from class:AtomContainer
Returns a one line description of this IChemObject.- Specified by:
toString
in interfaceIChemObject
- Overrides:
toString
in classAtomContainer
- Returns:
- a String representation of this object
-
clone
public IStrand clone() throws CloneNotSupportedException
Description copied from class:AtomContainer
Clones thisIChemObject
. It clones the identifier, flags, properties and pointer vectors. The ChemObjectListeners are not cloned, and neither is the content of the pointer vectors.- Specified by:
clone
in interfaceIAtomContainer
- Specified by:
clone
in interfaceIChemObject
- Specified by:
clone
in interfaceIStrand
- Overrides:
clone
in classAtomContainer
- Returns:
- The cloned object
- Throws:
CloneNotSupportedException
- if the IChemObject cannot be cloned
-
-