org.xmlcml.tools
Interface AtomSet

All Known Implementing Classes:
AtomSetImpl

public interface AtomSet
extends ToolHashSet

a set of atoms. Counts number of times an atom has been added (e.g. for bonds). Will normally be implemented by HashSet.


Method Summary
 void addAtom(Atom atom)
          add an atom.
 void addBond(Bond bond)
          adds both atoms in the bond
 AtomSet and(AtomSet atomSet)
          combines this with AtomSet to find common elements, else null.
 void clearCoordinate2()
          clear atom coordinate table
 Coordinate2 getCoordinate2(Atom atom)
          get coordinates for atom
 int getCount(Atom atom)
          how many times has atom been added (0 means atom is not in set
 AtomSet not(AtomSet atomSet)
          combines this with AtomSet to find elements NOT in AtomSet, else null.
 AtomSet or(AtomSet atomSet)
          combines this with AtomSet to find all elements.
 void setCoordinate2(Atom atom, Coordinate2 c)
          set coordinates for atom
 void transform(Transform2 t2)
          transform coordinates of all atoms in the set (rather inefficient) Works on original molecule - probably obsolete
 void translateBy(Real2 offset)
          translate coordinates of all atoms in the setWorks on original molecule - probably obsolete
 AtomSet xor(AtomSet atomSet)
          combines this with AtomSet to find elements NOT in common, else null.
 
Methods inherited from interface org.xmlcml.tools.ToolHashSet
add, addAll, and, clone, contains, debug, iterator, not, or, remove, removeAll, retainAll, size, xor
 

Method Detail

addAtom

public void addAtom(Atom atom)
             throws CMLException
add an atom. If atom already present, increments count

addBond

public void addBond(Bond bond)
             throws CMLException
adds both atoms in the bond

and

public AtomSet and(AtomSet atomSet)
            throws CMLException
combines this with AtomSet to find common elements, else null.

xor

public AtomSet xor(AtomSet atomSet)
            throws CMLException
combines this with AtomSet to find elements NOT in common, else null.

not

public AtomSet not(AtomSet atomSet)
            throws CMLException
combines this with AtomSet to find elements NOT in AtomSet, else null.

or

public AtomSet or(AtomSet atomSet)
           throws CMLException
combines this with AtomSet to find all elements.

getCount

public int getCount(Atom atom)
how many times has atom been added (0 means atom is not in set

clearCoordinate2

public void clearCoordinate2()
clear atom coordinate table

setCoordinate2

public void setCoordinate2(Atom atom,
                           Coordinate2 c)
                    throws CMLException
set coordinates for atom

getCoordinate2

public Coordinate2 getCoordinate2(Atom atom)
                           throws CMLException
get coordinates for atom

transform

public void transform(Transform2 t2)
transform coordinates of all atoms in the set (rather inefficient) Works on original molecule - probably obsolete

translateBy

public void translateBy(Real2 offset)
translate coordinates of all atoms in the setWorks on original molecule - probably obsolete