chemaxon.struc.sgroup
Class MultipleSgroup

java.lang.Object
  extended bychemaxon.struc.Sgroup
      extended bychemaxon.struc.sgroup.MultipleSgroup
All Implemented Interfaces:
Expandable, java.io.Serializable

public class MultipleSgroup
extends Sgroup
implements Expandable

S-group.

Since:
3.3, 08/17/2003
Version:
3.3, 01/03/2004
Author:
Peter Csizmadia
See Also:
Serialized Form

Field Summary
 
Fields inherited from class chemaxon.struc.Sgroup
SCN_EITHER_UNKNOWN, SCN_HEAD_TO_HEAD, SCN_HEAD_TO_TAIL, sgroupGraph, sgroupType, SST_ALTERNATING, SST_BLOCK, SST_RANDOM, ST_ANY, ST_COPOLYMER, ST_CROSSLINK, ST_DATA, ST_FORMULATION, ST_GENERIC, ST_MER, ST_MIXTURE, ST_MODIFICATION, ST_MONOMER, ST_MULTIPLE, ST_SRU, ST_SUPERATOM
 
Fields inherited from interface chemaxon.struc.sgroup.Expandable
DEFAULT_OPTIONS, MDL_EXPAND
 
Constructor Summary
MultipleSgroup(Molecule parent, boolean expanded)
          Constructs a multiple S-group.
 
Method Summary
 boolean contract(int opts)
          Contracts this S-group.
protected  void copy(Sgroup sg2, Molecule m)
          Make a copy of this S-group.
 boolean expand(int opts)
          Expands this S-group.
 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.
 java.lang.String getSubscript()
          Gets the subscript.
 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.
 void removeAtom(MolAtom a)
          Removes an atom from the S-group.
 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(java.lang.String s)
          Sets the subscript.
 
Methods inherited from class chemaxon.struc.Sgroup
add, cloneStructure, countAllAtoms, createMolecule, findCrossingBonds, getAtom, getAtomArray, getAtomCount, getConnectivity, getCrossingAtoms, getParentMolecule, getSgroupGraph, getSubType, getSuperscript, getType, hasBrackets, indexOf, isEmpty, removeBond, removeEdges, removeGroupedAtom, setConnectivity, setParentMolecule, setSgroupGraph, setSubType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipleSgroup

public MultipleSgroup(Molecule parent,
                      boolean expanded)
Constructs a multiple S-group.

Parameters:
parent - the parent molecule
expanded - whether the S-group is created in expanded state or not
Method Detail

isRepeatingUnitAtom

public final boolean isRepeatingUnitAtom(MolAtom a)
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

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

public final MolAtom getRepeatingUnitAtom(int i)
Gets a paradigmatic repeating unit atom.

Parameters:
i - the paradigmatic repeating unit atom index
Returns:
the paradigmatic repeating unit atom

setRepeatingUnitAtom

public final void setRepeatingUnitAtom(MolAtom a,
                                       boolean set)
Adds or removes an atom to/from the list of paradigmatic repeating unit atoms.

Parameters:
a - the atom
set - add (true) or remove (false)

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

public Sgroup newInstance()
Gets a new MultipleSgroup instance.

Overrides:
newInstance in class Sgroup
Returns:
the new object

setAtom

public final void setAtom(int i,
                          MolAtom a)
Sets the specified atom in the S-group graph.

Overrides:
setAtom in class Sgroup
Parameters:
i - the index
a - the atom

removeAtom

public final void removeAtom(MolAtom a)
Removes an atom from the S-group.

Overrides:
removeAtom in class Sgroup
Parameters:
a - the atom

copy

protected final void copy(Sgroup sg2,
                          Molecule m)
Make a copy of this S-group.

Overrides:
copy in class Sgroup
Parameters:
sg2 - the target S-group
m - the target molecule or null

setSubscript

public void setSubscript(java.lang.String s)
Sets the subscript.

Overrides:
setSubscript in class Sgroup
Parameters:
s - the multiplier as a string

getSubscript

public java.lang.String getSubscript()
Gets the subscript.

Overrides:
getSubscript in class Sgroup
Returns:
the subscript in contracted state, empty string in expanded state

expand

public final boolean expand(int opts)
Expands this S-group.

Specified by:
expand in interface Expandable
Parameters:
opts - expansion options
Returns:
true if the operation was successful, false if already expanded
See Also:
Expandable.DEFAULT_OPTIONS, Expandable.MDL_EXPAND

isExpanded

public final boolean isExpanded()
Is this S-group expanded?

Specified by:
isExpanded in interface Expandable
Returns:
true if expanded, false if contracted

contract

public final boolean contract(int opts)
Contracts this S-group.

Specified by:
contract in interface Expandable
Parameters:
opts - contraction options
Returns:
true if the operation was successful, false if already contracted
See Also:
Expandable.DEFAULT_OPTIONS

isContracted

public final boolean isContracted()
Is this S-group contracted?

Returns:
true if contracted, false if expanded