Package chemaxon.struc.sgroup
Class MultipleSgroup
java.lang.Object
chemaxon.struc.Sgroup
chemaxon.struc.sgroup.MultipleSgroup
- All Implemented Interfaces:
Expandable,Serializable
Multiple S-group.
- Since:
- Marvin 3.3, 08/17/2003
- See Also:
-
Field Summary
Fields inherited from class chemaxon.struc.Sgroup
atomSet, brackets, CHARGE_ON_ATOMS, CHARGE_ON_GROUP, parentSgroup, PR_ATSYMS, RA_IN_EXPAND, RA_REMOVE_EXCEPT_RU, SCN_EITHER_UNKNOWN, SCN_HEAD_TO_HEAD, SCN_HEAD_TO_TAIL, SGROUP_TYPE_COUNT, sgroupGraph, sgroupType, SORT_CHILD_PARENT, SORT_PARENT_CHILD, SST_ALTERNATING, SST_BLOCK, SST_RANDOM, ST_AMINOACID, ST_ANY, ST_COMPONENT, ST_COPOLYMER, ST_CROSSLINK, ST_DATA, ST_FORMULATION, ST_GENERIC, ST_GRAFT, ST_MER, ST_MIXTURE, ST_MODIFICATION, ST_MONOMER, ST_MULTICENTER, ST_MULTIPLE, ST_SRU, ST_SUPERATOM, XSTATE_C, XSTATE_NONE, XSTATE_X, XSTATE_XCFields inherited from interface chemaxon.struc.sgroup.Expandable
COORDS_UPDATE, DEFAULT_OPTIONS, FAST_COORDS, LEAVE_COORDS_UNCHANGED, MDL_EXPAND, NONRECURSIVE_EXPAND, REVERSIBLE_EXPAND -
Constructor Summary
ConstructorsModifierConstructorDescriptionMultipleSgroup(Molecule parent, boolean expanded) Constructs a multiple S-group.protectedMultipleSgroup(MultipleSgroup sg, Molecule m, Sgroup psg, int[] atomIndexMap) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new atom to the S-group.final voidAdds an atom to the list of paradigmatic repeating unit atoms.protected voidcheckBonds(MolAtom atom) Add the bonds of the given atom to the S-group if the given atom and the other atom of the selected bond are both in the S-group.protected SgroupcloneSgroup(Molecule m, Sgroup psg, int[] atomIndexMap) Gets a new Sgroup instance.final booleancontract(int opts) Contracts this S-group.final booleanexpand(int opts) Expands this S-group unless it has expandable child s-group because in that case our calculations' behaviour can not be predicted.final intGets the multiplier.final MolAtomgetRepeatingUnitAtom(int i) Gets a paradigmatic repeating unit atom.final intGets the number of atoms in the pararadigmatic repeating unit.final MolAtom[]Gets the repeating unit atoms.Gets the subscript.static booleanisAcceptableGraph(MoleculeGraph molGraph) Decides whether the given molecule graph can be the graph of a multiple s-group.booleanTests whether the bracket is visible.final booleanIs this S-group contracted?final booleanIs this S-group expanded?final booleanChecks if the specified atom object is in the paradigmatic repeating unit or not.Gets a new MultipleSgroup instance.protected final voidremoveAtom(MolAtom a, int opts) Removes an atom from the S-group.final voidRemoves an atom from the list of paradigmatic repeating unit atoms.final voidreplaceAtom(MolAtom olda, MolAtom newa, int opts) Replace an existing atom by a new one.final voidSets the specified atom in the S-group graph.final voidsetMultiplier(int m) Sets the multiplier.final voidsetRepeatingUnitAtom(MolAtom a, boolean set) Adds or removes an atom to/from the list of paradigmatic repeating unit atoms.voidSets the subscript.toString(int opts) Returns a string representation of the group.Methods inherited from class chemaxon.struc.Sgroup
addBracket, addChildSgroup, areChildSgroupsVisible, checkConsistency, checkConsistencyInEmbeddings, checkSgroupGraphConsistency, clearObjects, cloneSgroup, cloneStructure, contains, containsAllAtomsOf, countAllAtoms, createMolecule, createMolecule, findCrossingBonds, findSmallestSgroupContaining, findSmallestSgroupOf, getAtom, getAtomArray, getAtomCount, getAtomSymbolListAsString, getAttach, getBondArray, getBracketCount, getBrackets, getChargeLocation, getChildSgroup, getChildSgroupCount, getChildSgroups, getConnectivity, getCrossingAtoms, getId, getParentMolecule, getParentSgroup, getSgroupGraph, getSgroupType, getSubType, getSuperscript, getTotalCharge, getType, getXState, hasAtom, hasBrackets, indexOf, indexOf, initBrackets, isBracketCrossingBond, isDescendantOf, isEmpty, isOrderedComponentSgroup, isPartSelected, isRemovable, isSelected, isTotalSelected, isVisible, removeAtom, removeAtom, removeBond, removeBonds, removeChildSgroup, removeGroupedAtom, removeObject, replaceAtom, selectAllObjects, setChargeLocation, setConnectivity, setGUIStateRecursively, setGUIStateRecursively, setId, setParentMolecule, setSgroupGraph, setSubType, setXState, setXState, setXState0, sort, toString, transformByParent
-
Constructor Details
-
MultipleSgroup
Constructs a multiple S-group. Please note the S-group is not added automatically to the parent molecule.- Parameters:
parent- the parent moleculeexpanded- whether the S-group is created in expanded state or not- See Also:
-
MultipleSgroup
Copy constructor.- Parameters:
sg- the S-group to copym- the new parent moleculepsg- the new parent S-group or null- Since:
- Marvin 3.4
-
-
Method Details
-
isRepeatingUnitAtom
Checks if the specified atom object is in the paradigmatic repeating unit or not.- Parameters:
a- the atom to check- Returns:
- true if it is in the paradigmatic repeating unit, false otherwise
-
isAcceptableGraph
Decides whether the given molecule graph can be the graph of a multiple s-group.- Parameters:
molGraph- molecule graph to check- Returns:
- true if the graph is acceptable as a multiple sgroup
- Since:
- Marvin 5.4.0, 01/27/2010
-
getRepeatingUnitAtomCount
public final int getRepeatingUnitAtomCount()Gets the number of atoms in the pararadigmatic repeating unit.- Returns:
- the number of atoms in the paradigmatic repeating unit
-
getRepeatingUnitAtom
Gets a paradigmatic repeating unit atom.- Parameters:
i- the paradigmatic repeating unit atom index- Returns:
- the paradigmatic repeating unit atom
-
getRepeatingUnitAtoms
Gets the repeating unit atoms.- Returns:
- the paradigmatic repeating unit atoms
-
addRepeatingUnitAtom
Adds an atom to the list of paradigmatic repeating unit atoms.- Parameters:
a- the atom to add
-
removeRepeatingUnitAtom
Removes an atom from the list of paradigmatic repeating unit atoms.- Parameters:
a- the atom to remove
-
setRepeatingUnitAtom
Adds or removes an atom to/from the list of paradigmatic repeating unit atoms.- Parameters:
a- the atomset- add (true) or remove (false)
-
checkBonds
Description copied from class:SgroupAdd the bonds of the given atom to the S-group if the given atom and the other atom of the selected bond are both in the S-group.- Overrides:
checkBondsin classSgroup- Parameters:
atom- the given atom
-
add
Adds a new atom to the S-group. -
getMultiplier
public final int getMultiplier()Gets the multiplier.- Returns:
- the multiplier
-
setMultiplier
public final void setMultiplier(int m) Sets the multiplier.- Parameters:
m- the multiplier
-
newInstance
Gets a new MultipleSgroup instance.- Returns:
- the new object
-
setAtom
Sets the specified atom in the S-group graph. -
removeAtom
Removes an atom from the S-group.- Overrides:
removeAtomin classSgroup- Parameters:
a- the atomopts- 0 orSgroup.RA_IN_EXPAND
-
replaceAtom
Replace an existing atom by a new one.- Overrides:
replaceAtomin classSgroup- Parameters:
olda- the original atomnewa- the new atomopts- options- Since:
- 4.1, 07/25/2006
- See Also:
-
cloneSgroup
Gets a new Sgroup instance.- Overrides:
cloneSgroupin classSgroup- Parameters:
m- the new parent moleculepsg- the new parent S-groupatomIndexMap- indices of cloned atoms in the original molecule in the case of partial cloning, ornullotherwise- Returns:
- the new object
- Since:
- Marvin 5.0.2, 03/07/2008
-
setSubscript
Sets the subscript.- Overrides:
setSubscriptin classSgroup- Parameters:
s- the multiplier as a string
-
getSubscript
Gets the subscript.- Overrides:
getSubscriptin classSgroup- Returns:
- the subscript in contracted state, empty string in expanded state
-
expand
public final boolean expand(int opts) Expands this S-group unless it has expandable child s-group because in that case our calculations' behaviour can not be predicted.- Specified by:
expandin interfaceExpandable- Overrides:
expandin classSgroup- Parameters:
opts- expansion options- Returns:
- true if the operation was successful, false if already expanded,
or has
Expandabledescendant - Throws:
IllegalArgumentException- if the group is invisible (it has a non-expanded parent)- See Also:
-
isExpanded
public final boolean isExpanded()Is this S-group expanded?- Specified by:
isExpandedin interfaceExpandable- Returns:
- true if expanded, false if contracted
-
contract
public final boolean contract(int opts) Contracts this S-group.- Specified by:
contractin interfaceExpandable- Overrides:
contractin classSgroup- Parameters:
opts- contraction options- Returns:
- true if the operation was successful, false if already contracted
- Throws:
IllegalArgumentException- if the group is invisible (it has a non-expanded parent)- See Also:
-
isContracted
public final boolean isContracted()Is this S-group contracted?- Returns:
- true if contracted, false if expanded
-
isBracketVisible
public boolean isBracketVisible()Tests whether the bracket is visible. Multiple S-group brackets are only visible in expanded state.- Overrides:
isBracketVisiblein classSgroup- Returns:
truein contracted,falsein expanded state- Since:
- Marvin 3.5.1, 11/12/2004
-
toString
Returns a string representation of the group.
-