org.xmlcml.tools
Class BondSetImpl

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
              |
              +--java.util.HashSet
                    |
                    +--org.xmlcml.tools.ToolHashSetImpl
                          |
                          +--org.xmlcml.tools.BondSetImpl
Direct Known Subclasses:
ChainSetImpl, RingImpl, RingNucleusImpl

public class BondSetImpl
extends ToolHashSetImpl
implements BondSet

a set of bonds, which also counts the atoms

See Also:
Serialized Form

Field Summary
protected  AtomSet atomSet
           
 
Constructor Summary
BondSetImpl()
           
 
Method Summary
 void addBond(Bond bond)
          add a bond, checking for nullity
 BondSet and(BondSet bondSet)
          combines this with BondSet to find common elements, else null.
 boolean containsAtom(Atom atom)
          does this BondSet contain a given atom?
 AtomSet getAtomSet()
          a BondSet always keeps count of the atoms in it
 BondSet not(BondSet bondSet)
          combines this with BondSet to find elements NOT in BondSet, else null.
 BondSet or(BondSet bondSet)
          combines this with BondSet to find all elements.
 java.lang.String toString()
           
 BondSet xor(BondSet bondSet)
          combines this with BondSet to find elements NOT in common, else null.
 
Methods inherited from class org.xmlcml.tools.ToolHashSetImpl
and, clone, debug, main, not, or, xor
 
Methods inherited from class java.util.HashSet
add, clear, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

atomSet

protected AtomSet atomSet
Constructor Detail

BondSetImpl

public BondSetImpl()
Method Detail

addBond

public void addBond(Bond bond)
             throws CMLException
add a bond, checking for nullity
Specified by:
addBond in interface BondSet

getAtomSet

public AtomSet getAtomSet()
a BondSet always keeps count of the atoms in it
Specified by:
getAtomSet in interface BondSet

containsAtom

public boolean containsAtom(Atom atom)
does this BondSet contain a given atom?
Specified by:
containsAtom in interface BondSet

and

public BondSet and(BondSet bondSet)
            throws CMLException
combines this with BondSet to find common elements, else null.
Specified by:
and in interface BondSet

xor

public BondSet xor(BondSet bondSet)
            throws CMLException
combines this with BondSet to find elements NOT in common, else null.
Specified by:
xor in interface BondSet

not

public BondSet not(BondSet bondSet)
            throws CMLException
combines this with BondSet to find elements NOT in BondSet, else null.
Specified by:
not in interface BondSet

or

public BondSet or(BondSet bondSet)
           throws CMLException
combines this with BondSet to find all elements.
Specified by:
or in interface BondSet

toString

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