public class MultipleSgroup extends Sgroup implements Expandable
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_XCCOORDS_UPDATE, DEFAULT_OPTIONS, FAST_COORDS, LEAVE_COORDS_UNCHANGED, MDL_EXPAND, NONRECURSIVE_EXPAND, REVERSIBLE_EXPAND| Modifier | Constructor and Description |
|---|---|
|
MultipleSgroup(Molecule parent,
boolean expanded)
Constructs a multiple S-group.
|
protected |
MultipleSgroup(MultipleSgroup sg,
Molecule m,
Sgroup psg,
int[] atomIndexMap)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(MolAtom a)
Adds a new atom to the S-group.
|
void |
addRepeatingUnitAtom(MolAtom a)
Adds an atom to the list of paradigmatic repeating unit atoms.
|
protected Sgroup |
cloneSgroup(Molecule m,
Sgroup psg,
int[] atomIndexMap)
Gets a new Sgroup instance.
|
boolean |
contract(int opts)
Contracts this S-group.
|
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.
|
int |
getMultiplier()
Gets the multiplier.
|
MolAtom |
getRepeatingUnitAtom(int i)
Gets a paradigmatic repeating unit atom.
|
int |
getRepeatingUnitAtomCount()
Gets the number of atoms in the pararadigmatic repeating unit.
|
MolAtom[] |
getRepeatingUnitAtoms()
Gets the repeating unit atoms.
|
String |
getSubscript()
Gets the subscript.
|
static boolean |
isAcceptableGraph(MoleculeGraph molGraph)
Decides whether the given molecule graph can be the graph of a multiple s-group.
|
boolean |
isBracketVisible()
Tests whether the bracket is visible.
|
boolean |
isContracted()
Is this S-group contracted?
|
boolean |
isExpanded()
Is this S-group expanded?
|
boolean |
isRepeatingUnitAtom(MolAtom a)
Checks if the specified atom object is in the paradigmatic repeating
unit or not.
|
Sgroup |
newInstance()
Gets a new MultipleSgroup instance.
|
protected void |
removeAtom(MolAtom a,
int opts)
Removes an atom from the S-group.
|
void |
removeRepeatingUnitAtom(MolAtom a)
Removes an atom from the list of paradigmatic repeating unit atoms.
|
void |
replaceAtom(MolAtom olda,
MolAtom newa,
int opts)
Replace an existing atom by a new one.
|
void |
setAtom(int i,
MolAtom a)
Sets the specified atom in the S-group graph.
|
void |
setMultiplier(int m)
Sets the multiplier.
|
void |
setRepeatingUnitAtom(MolAtom a,
boolean set)
Adds or removes an atom to/from the list of paradigmatic repeating
unit atoms.
|
void |
setSubscript(String s)
Sets the subscript.
|
String |
toString(int opts)
Returns a string representation of the group.
|
addBracket, addChildSgroup, areChildSgroupsVisible, checkBondConsistency, checkBonds, 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, 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, setParentMolecule, setSgroupGraph, setSubType, setXState, setXState, setXState0, sort, toString, transformByParentpublic MultipleSgroup(Molecule parent, boolean expanded)
parent - the parent moleculeexpanded - whether the S-group is created in expanded state or notprotected MultipleSgroup(MultipleSgroup sg, Molecule m, Sgroup psg, int[] atomIndexMap)
sg - the S-group to copym - the new parent moleculepsg - the new parent S-group or nullpublic final boolean isRepeatingUnitAtom(MolAtom a)
a - the atom to checkpublic static boolean isAcceptableGraph(MoleculeGraph molGraph)
molGraph - molecule graph to checkpublic final int getRepeatingUnitAtomCount()
public final MolAtom getRepeatingUnitAtom(int i)
i - the paradigmatic repeating unit atom indexpublic final MolAtom[] getRepeatingUnitAtoms()
public final void addRepeatingUnitAtom(MolAtom a)
a - the atom to addpublic final void removeRepeatingUnitAtom(MolAtom a)
a - the atom to removepublic final void setRepeatingUnitAtom(MolAtom a, boolean set)
a - the atomset - add (true)
or remove (false)public void add(MolAtom a)
public final int getMultiplier()
public final void setMultiplier(int m)
m - the multiplierpublic Sgroup newInstance()
public final void setAtom(int i,
MolAtom a)
protected final void removeAtom(MolAtom a, int opts)
removeAtom in class Sgroupa - the atomopts - 0 or Sgroup.RA_IN_EXPANDpublic final void replaceAtom(MolAtom olda, MolAtom newa, int opts)
replaceAtom in class Sgroupolda - the original atomnewa - the new atomopts - optionsSgroup.RA_REMOVE_EXCEPT_RUprotected Sgroup cloneSgroup(Molecule m, Sgroup psg, int[] atomIndexMap)
cloneSgroup in class Sgroupm - the new parent moleculepsg - the new parent S-groupatomIndexMap - indices of cloned atoms in the original molecule
in the case of partial cloning, or null otherwisepublic void setSubscript(String s)
setSubscript in class Sgroups - the multiplier as a stringpublic String getSubscript()
getSubscript in class Sgrouppublic final boolean expand(int opts)
expand in interface Expandableexpand in class Sgroupopts - expansion optionsExpandable descendantIllegalArgumentException - if the group is invisible (it has a non-expanded parent)Sgroup.setXState(int)public final boolean isExpanded()
isExpanded in interface Expandablepublic final boolean contract(int opts)
contract in interface Expandablecontract in class Sgroupopts - contraction optionsIllegalArgumentException - if the group is invisible
(it has a non-expanded parent)Sgroup.setXState(int)public final boolean isContracted()
public boolean isBracketVisible()
isBracketVisible in class Sgrouptrue in contracted, false in expanded
statepublic String toString(int opts)
toString in class Sgroupopts - options or 0Sgroup.PR_ATSYMS