Package chemaxon.struc.sgroup
Class SgroupAtom
- java.lang.Object
-
- chemaxon.struc.MolAtom
-
- chemaxon.struc.sgroup.SgroupAtom
-
- All Implemented Interfaces:
StereoConstants
,Serializable
@PublicAPI public class SgroupAtom extends MolAtom
S-group superatom.- Since:
- Marvin 3.0, 11/05/2002
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
LABEL_AUTO
static int
LABEL_DEFAULT
-
Fields inherited from class chemaxon.struc.MolAtom
AAMAP_MASK, AAMAP_MAX, AAMAP_OFF, ALIPHATIC, ALL_H, ANGLE_STEP, ANY, AROMATIC, AROMATIC_OR_ALIPHATIC, ATOM_TYPE_COUNT, ATOM_TYPE_MAX, ATTACH_BOTH, ATTACH_NONE, ATTACH_UNKNOWN, ATTACH1, ATTACH2, bondCount, BRIDGEHEAD_H, CHARGED_H, CTSPECIFIC_H, ELEMENT_COUNT, EMPTY, FIX_CHARGE, HBONDED_H, HCONNECTED_H, HETERO, HS_S, HS_SP, HS_SP2, HS_SP3, HS_UNKNOWN, ISOTOPE_H, LDIR_ABOVE, LDIR_BELOW, LDIR_LEFT, LDIR_RIGHT, LIST, LONELY_H, LP, MAPPED_H, METALCONNECTED_H, MULTICENTER, NOTLIST, OMIT_POSTCLEAN, POLYMERENDGROUP_H, PSEUDO, RAD_COUNT_MASK, RAD_MASK, RAD_OFF, RAD1, RAD2, RAD2_SINGLET, RAD2_TRIPLET, RAD3, RAD3_DOUBLET, RAD3_QUARTET, RAD4, RADICAL_CHAR, RADICAL_H, RESSEQ_MAX, RESTYPE_MAX, RGROUP, RGROUP_ATTACHMENT, RGROUP_MAX, RXNSTEREO_INVERSION, RXNSTEREO_NONE, RXNSTEREO_RETENTION, SETSEQ_MAX, SGROUP, SGROUP_H, SGROUPEND_H, SMARTS_H_DAYLIGHT_COMP_MODE, SMARTS_H_MARVIN_COMP_MODE, STAR, SYM_CX, SYM_EXPLH, SYM_IMPLH, SYM_MOLEX, SYM_NEUTRAL, SYM_SMARTS, SYM_SQBRACKETS, theBonds, UNSPECIFIED_AROMATICITY, VALENCE_CHECKED, VALENCE_ERROR, VALENCEERROR_H, WEDGED_H, xCoordinate, yCoordinate, zCoordinate
-
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_ALL_POSSIBLE, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CIS_TRANS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_NONE, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
-
-
Constructor Summary
Constructors Constructor Description SgroupAtom(SuperatomSgroup sg)
Constructs a superatom for a superatom type S-group.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
add(MolBond edge)
Add an edge if it had not been already added.protected boolean
add(MolBond edge, MolAtom atom)
Add an edge to the given atom of the sgroup, if it had not been already added.SgroupAtom
clone()
Clones the S-group superatom and it'sSuperatomSgroup
as well.SgroupAtom
cloneFromSgroupCopy()
Clones the S-group superatom partially.protected int
countAllAtoms()
Counts all atoms represented by this atom.String
getAtomSymbol(int style, int flags, int[] lcenter, CTransform3D preTransform)
Gets the string representation of the atom symbol.int
getCharge()
Returns the sum of the charges in the corresponding superatom s-group.int
getLabelCenter()
Gets the index of the character in the label the bonds should point to.String
getLeftName()
Gets the string that will be shown at the left side of the molecule.String
getRightName()
Set the string that will be shown at the right side of the molecule.SuperatomSgroup
getSgroup()
Gets the S-group corresponding to this superatom.String
getSymbol()
Gets the abbreviated group symbol.boolean
hasAlternativeName()
Checks whether there is an alternative name at all.boolean
hasValenceError()
Checks if any atom of the Sgroup has a valence error.int
indexOf(MolBond bond)
Returns the index of the specified bond in this atom.protected void
insertBond(int index, MolBond bond)
Inserts a bond at a specified index.protected void
removeAllBonds()
Remove all edges.protected void
removeAllBonds(boolean clearFromAttachmentPoints)
Removes all edges.protected void
removeBond(int i, boolean clearFromAttachmentPoints)
Removes a bond.protected void
removeBond(MolBond bond, boolean clearFromAttachmentPoints)
Removes a bond by reference.void
set(MolAtom atom)
Set properties of this S-group superatom.protected static void
setAtom1(MolBond edge, MolAtom newnode)
Sets the first node of an edge.protected static void
setAtom2(MolBond edge, MolAtom newnode)
Sets the second node of an edge.protected void
setFromSgroupCopy(SgroupAtom sa)
Make a copy of this S-group superatom.void
setLabelCenter(int k)
Sets the index of the character in the label the bonds should point to.void
setLeftName(String s)
Set the string that will be shown at the left side of the molecule.void
setRightName(String s)
Set the string that will be shown at the right side of the molecule.void
transform(CTransform3D t, boolean incg)
Apply a transformation matrix to the coordinates.-
Methods inherited from class chemaxon.struc.MolAtom
addRgroupAttachmentPoint, bonds, bondweights, checkAtno, clear, clearExtraLabel, clearProperties, clearQProps, containsPropertyKey, covalentRadiusOf, decQProp, decValenceProp, electronegOf, getAliasstr, getAtno, getAtomicNumber, getAtomMap, getAttach, getAttachFromExtraAtomProp, getAttachParentSgroup, getBicycloStereo, getBond, getBondArray, getBondCount, getBondTo, getChargeAngle, getColumn, getElectronProp, getExplicitHcount, getExtraLabel, getExtraLabelColor, getExtraLabelColor, getExtraLabelColor, getExtraLabelSetSeq, getFlags, getHybridizationState, getImplicitHcount, getImplicitHCount, getLigand, getLigandIndex, getLigandOrder, getLigands, getLinkNodeOuterAtom, getList, getLocation, getLocation, getLock, getLonePairCount, getMass, getMassno, getMaxRepetitions, getMinRepetitions, getNonQueryImplicitHcount, getParent, getPreferredLabelDir, getProperty, getQProp, getQPropAsInt, getQPropMinMax, getQPropNames, getQPropNameSet, getQueryAromaticity, getQueryLabel, getQuerystr, getQueryString, getRadical, getRadicalCount, getRadicalValue, getReactionStereo, getRealBondCount, getRelativeNegativity, getResidueAtomId, getResidueSeq, getResidueType, getRgroup, getRgroupAttachmentPointOrder, getRow, getSetSeq, getStereoCare, getStereoGroupNumber, getStereoGroupType, getTemporaryObject, getValence, getValenceProp, getValencePropMinMax, getX, getY, getZ, hasAromaticBond, hasCharge, hasQProps, hasQueryBonds, hasSameCharge, hasSMARTSProps, hasSMARTSPropsExcluding, hasWedgedBond, haveEqualProperties, haveSimilarBonds, incQProp, incQueryAromaticity, incValenceProp, indexOfReferenced, insideLabel, ionChargeOf, isAmbiguousStereo, isAromaticSMILESSubset, isBoundTo, isChargeAngleSet, isGeneric, isImplicitizableH, isLinkNode, isMappable, isotopeType, isPlainHydrogen, isPseudo, isQProp, isQuery, isSameParityClass, isSelected, isSpecIsotopeSymbolPreferred, isSpecIsotopeSymbolUsed, isTerminalAtom, ligands, maxAbsOxStateOf, moveCorners, nameOf, naturalWeightOf, negOxOf, numOf, numoxstatesOf, oxstateOf, pack, paritySign, posOxOf, propertyCount, propertyKeySet, propertySet, putProperty, qpropCheck, removeBond, removeBond, removeProperty, residueSymbolOf, residueTypeOf, setAliasstr, setAtno, setAtomMap, setAttach, setAttach, setAttachParentSgroup, setBicycloStereo, setCharge, setChargeAngle, setCorners, setElectronProp, setExtraLabel, setExtraLabelColor, setExtraLabelColor, setExtraLabelSetSeq, setFlags, setFlags, setForSpecIsotopeSymbol, setHybridizationState, setImplicitHBasedOnValence, setImplicitHcount, setIsValenceCheckNeeded, setLigandOrder, setLinkNodeDefaultOuters, setLinkNodeOuterAtom, setList, setList, setLocation, setMassno, setMaxRepetitions, setMinRepetitions, setNonQueryImplicitHcount, setQProp, setQProp, setQueryAromaticity, setQuerystr, setQuerystr, setQueryString, setRadical, setRadicalValue, setReactionStereo, setResidueAtomId, setResidueSeq, setResidueType, setRgroup, setRgroupAttachmentPointOrder, setSelected, setSetSeq, setSMARTS, setSpecIsotopeSymbolPreferred, setStereoGroupNumber, setStereoGroupType, setValenceError, setValenceProp, setX, setXY, setXYZ, setY, setZ, sringsize, storeTemporaryObject, symbolOf, symbolOf, toString, twicesumbonds, valenceCheck
-
-
-
-
Field Detail
-
LABEL_DEFAULT
public static final int LABEL_DEFAULT
- See Also:
- Constant Field Values
-
LABEL_AUTO
public static final int LABEL_AUTO
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SgroupAtom
public SgroupAtom(SuperatomSgroup sg)
Constructs a superatom for a superatom type S-group.- Parameters:
sg
- the S-group
-
-
Method Detail
-
getSgroup
public SuperatomSgroup getSgroup()
Gets the S-group corresponding to this superatom.- Returns:
- the S-group
-
getAtomSymbol
public String getAtomSymbol(int style, int flags, int[] lcenter, CTransform3D preTransform)
Gets the string representation of the atom symbol.- Overrides:
getAtomSymbol
in classMolAtom
- Parameters:
style
- neglectedflags
- neglectedpreTransform
- neglectedlcenter
- neglected- Returns:
- the S-group name with the numbers subscripted
- See Also:
MolAtom.SYM_SQBRACKETS
,MolAtom.SYM_IMPLH
,MolAtom.SYM_EXPLH
,MolAtom.SYM_NEUTRAL
,MolAtom.SYM_SMARTS
,MolAtom.SYM_MOLEX
-
clone
public SgroupAtom clone()
Clones the S-group superatom and it'sSuperatomSgroup
as well.
-
set
public void set(MolAtom atom)
Set properties of this S-group superatom.
-
cloneFromSgroupCopy
public SgroupAtom cloneFromSgroupCopy()
Clones the S-group superatom partially. This method is needed to prevent infinite recursion when cloning from SuperatomSgroup.copy. Use it only for this purpose.- Returns:
- the clone
-
transform
public void transform(CTransform3D t, boolean incg)
Apply a transformation matrix to the coordinates.
-
getSymbol
public String getSymbol()
Gets the abbreviated group symbol.
-
getLeftName
public String getLeftName()
Gets the string that will be shown at the left side of the molecule.- Returns:
- the left name string
- Since:
- Marvin 4.1
-
setLeftName
public void setLeftName(String s)
Set the string that will be shown at the left side of the molecule.- Parameters:
s
-- Since:
- Marvin 4.1
-
getRightName
public String getRightName()
Set the string that will be shown at the right side of the molecule.- Since:
- Marvin 4.1
-
setRightName
public void setRightName(String s)
Set the string that will be shown at the right side of the molecule.- Parameters:
s
-- Since:
- Marvin 4.1
-
hasAlternativeName
public boolean hasAlternativeName()
Checks whether there is an alternative name at all.- Returns:
- true if an alternative name is available for the (s)group
- Since:
- Marvin 4.1
-
hasValenceError
public boolean hasValenceError()
Checks if any atom of the Sgroup has a valence error.- Overrides:
hasValenceError
in classMolAtom
- Returns:
- true if at least one atom of this Sgroup has a valence error
- See Also:
MolAtom.valenceCheck()
-
getLabelCenter
public int getLabelCenter()
Gets the index of the character in the label the bonds should point to.- Returns:
- character index + 1, or
LABEL_DEFAULT
for default behavior (geometrical center unless alternative name is specified), orLABEL_AUTO
for automatic calculation - Since:
- Marvin 4.1
-
setLabelCenter
public void setLabelCenter(int k)
Sets the index of the character in the label the bonds should point to.- Parameters:
k
- character index + 1, orLABEL_DEFAULT
for default behavior (geometrical center unless alternative name is specified), orLABEL_AUTO
for automatic calculation- Since:
- Marvin 4.1
-
setFromSgroupCopy
protected void setFromSgroupCopy(SgroupAtom sa)
Make a copy of this S-group superatom. Clones the S-group superatom partially. This method is needed to prevent infinite recursion when cloning from SuperatomSgroup.copy.- Parameters:
sa
- the target atom- Since:
- Marvin 4.1, 01/01/2006
-
add
protected boolean add(MolBond edge)
Add an edge if it had not been already added. Overridden to enable access from other classes of this package.
-
add
protected boolean add(MolBond edge, MolAtom atom)
Add an edge to the given atom of the sgroup, if it had not been already added.- Parameters:
edge
- the edge to add- Throws:
chemaxon.struc.sgroup.NoFreeAttachmentPointException
- if there is no free attachment point for the given edge.
-
removeBond
protected void removeBond(int i, boolean clearFromAttachmentPoints)
Removes a bond.- Overrides:
removeBond
in classMolAtom
- Parameters:
i
- bond index
-
removeBond
protected void removeBond(MolBond bond, boolean clearFromAttachmentPoints)
Removes a bond by reference.- Overrides:
removeBond
in classMolAtom
- Parameters:
bond
- bond reference to remove
-
insertBond
protected void insertBond(int index, MolBond bond)
Description copied from class:MolAtom
Inserts a bond at a specified index.- Overrides:
insertBond
in classMolAtom
- Parameters:
index
- the index where to insert the bondbond
- the bond reference to insert
-
setAtom1
protected static void setAtom1(MolBond edge, MolAtom newnode)
Sets the first node of an edge. Overridden to enable access from other classes of this package.- Parameters:
edge
- the edgenewnode
- the new node value
-
setAtom2
protected static void setAtom2(MolBond edge, MolAtom newnode)
Sets the second node of an edge. Overridden to enable access from other classes of this package.- Parameters:
edge
- the edgenewnode
- the new node value
-
removeAllBonds
protected void removeAllBonds()
Remove all edges.- Overrides:
removeAllBonds
in classMolAtom
-
removeAllBonds
protected void removeAllBonds(boolean clearFromAttachmentPoints)
Removes all edges. If the parameter clearFromAttachmentPoints is true, then the bonds are cleared from the SgroupAtoms's s-group's attachment points- Overrides:
removeAllBonds
in classMolAtom
- Parameters:
clearFromAttachmentPoints
-
-
countAllAtoms
protected int countAllAtoms()
Counts all atoms represented by this atom.- Overrides:
countAllAtoms
in classMolAtom
- Returns:
- the number of atoms in the S-group
-
getCharge
public int getCharge()
Returns the sum of the charges in the corresponding superatom s-group.
-
indexOf
public int indexOf(MolBond bond)
Returns the index of the specified bond in this atom. This method uses==
for the bond comparison.- Overrides:
indexOf
in classMolAtom
- Parameters:
bond
- bond reference- Returns:
- the bond index, or
-1
if it not found - Since:
- Marvin 6.1, 2013.06.23.
- See Also:
Object.equals(Object)
-
-