org.xmlcml.tools
Class RingOverlapImpl

java.lang.Object
  |
  +--org.xmlcml.tools.RingOverlapImpl

public class RingOverlapImpl
extends java.lang.Object
implements RingOverlap

holds information about overlap between two rings (fused or bridged). At present propellanes will give three distinct RingOverlaps - I shall probably change this.


Field Summary
protected  Atom atom1
          bridgehead atoms
protected  Atom atom2
           
protected  AtomSet atomSet
          atoms in the overlap
protected  BondSet bondSet
          bonds in the overlap
static int BRIDGED
          rings are fused (two or more bonds in common)
static int FUSED
          rings are fused (one bond in common)
protected  java.util.Vector orderedBondVector
          ordered bonds - traversal starts at one bridgehead and ends at the other
protected  Ring[] rings
          rings involved
protected  int type
          type of overlap (FUSED/BRIDGED)
static java.lang.String[] typeString
           
static int UNKNOWN
          state is unknown
 
Fields inherited from interface org.xmlcml.tools.RingOverlap
BRIDGED, FUSED, typeString, UNKNOWN
 
Constructor Summary
RingOverlapImpl()
           
RingOverlapImpl(Ring ring1, Ring ring2)
          create from two rings.
 
Method Summary
 AtomSet getAtomSet()
          get the atoms in the overlap
 BondSet getBondSet()
          get the bonds in the overlap
 Atom getBridgeheadAtom(int i)
          returns atoms at end o bridgehead (i=0 or i=1)
 java.util.Vector getOrderedBondVector()
          get the ordered bonds in the overlap
 Ring getOtherRing(Ring ring)
          if exactly two rings, return the other one
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
state is unknown

FUSED

public static final int FUSED
rings are fused (one bond in common)

BRIDGED

public static final int BRIDGED
rings are fused (two or more bonds in common)

typeString

public static final java.lang.String[] typeString

type

protected int type
type of overlap (FUSED/BRIDGED)

rings

protected Ring[] rings
rings involved

atom1

protected Atom atom1
bridgehead atoms

atom2

protected Atom atom2

atomSet

protected AtomSet atomSet
atoms in the overlap

bondSet

protected BondSet bondSet
bonds in the overlap

orderedBondVector

protected java.util.Vector orderedBondVector
ordered bonds - traversal starts at one bridgehead and ends at the other
Constructor Detail

RingOverlapImpl

public RingOverlapImpl()

RingOverlapImpl

public RingOverlapImpl(Ring ring1,
                       Ring ring2)
                throws CMLException
create from two rings. If these do not have bonds in common, throw Exception.
Method Detail

getOrderedBondVector

public java.util.Vector getOrderedBondVector()
Description copied from interface: RingOverlap
get the ordered bonds in the overlap
Specified by:
getOrderedBondVector in interface RingOverlap
Tags copied from interface: RingOverlap
Returns:
Vector the bonds (ordered)

getOtherRing

public Ring getOtherRing(Ring ring)
if exactly two rings, return the other one
Specified by:
getOtherRing in interface RingOverlap

getBridgeheadAtom

public Atom getBridgeheadAtom(int i)
Description copied from interface: RingOverlap
returns atoms at end o bridgehead (i=0 or i=1)
Specified by:
getBridgeheadAtom in interface RingOverlap

getAtomSet

public AtomSet getAtomSet()
get the atoms in the overlap
Specified by:
getAtomSet in interface RingOverlap
Returns:
AtomSet the atoms (unordered)

getBondSet

public BondSet getBondSet()
get the bonds in the overlap
Specified by:
getBondSet in interface RingOverlap
Returns:
BondSet the bonds (unordered)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object