The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Interface BondingSystemCollection

All Known Subinterfaces:
Molecule
All Known Implementing Classes:
BasicBondingSystemCollection, MoleculeDecorator

public interface BondingSystemCollection

BondingSystemCollection represents an immutable group of BondingSystems. Any BondingSystem may be present, but null is disallowed. BondingSystems from different Molecules may or not be present, depending on implementation.

BondingSystemCollection places the additional restriction on implementors that all methods are consistent - they can be assumed to return the same results throughout the Object's lifetime.

Author:
Richard Apodaca
See Also:
"Immutable Pattern (Grand98)"

Method Summary
 boolean containsBondingSystem(BondingSystem system)
          Returns true if a BondingSystem matching system is contained in this collection.
 int countBondingSystems()
          Returns the number of BondingSystems contained in this collection.
 int countBondingSystems(Atom atom)
          Returns the number of BondingSystems in this collection in which atom participates.
 BondingSystem getBondingSystem(int index)
          Returns the BondingSystem located at the specified zero-based index.
 int getBondingSystemIndex(BondingSystem system)
          Returns the zero-based index of the specified BondingSystem.
 BondingSystemIterator iterateBondingSystems()
          Returns an iterator over all BondingSystems in this collection.
 BondingSystemIterator iterateBondingSystems(Atom atom)
          Returns an iterator over all BondingSystems in which atom participates.
 BondingSystem[] toBondingSystemArray()
          Returns a copy of the bonding systems contained in this collection as an array.
 

Method Detail

containsBondingSystem

public boolean containsBondingSystem(BondingSystem system)
Returns true if a BondingSystem matching system is contained in this collection.

Parameters:
system - the BondingSystem to search for
Returns:
true if found, false otherwise

countBondingSystems

public int countBondingSystems()
Returns the number of BondingSystems contained in this collection.

Returns:
the number of BondingSystems contained in this collection.

countBondingSystems

public int countBondingSystems(Atom atom)
Returns the number of BondingSystems in this collection in which atom participates.

Parameters:
atom - the Atom
Returns:
the number of BondingSystems in this collection in which atom participates

getBondingSystem

public BondingSystem getBondingSystem(int index)
Returns the BondingSystem located at the specified zero-based index.

Parameters:
index - the index
Returns:
the BondingSystem at index
Throws:
java.lang.IndexOutOfBoundsException - if index is less than zero or greater than or equal to the number of Atoms

getBondingSystemIndex

public int getBondingSystemIndex(BondingSystem system)
Returns the zero-based index of the specified BondingSystem.

Parameters:
system - the BondingSystem
Returns:
the index of the BondingSystem, or -1 if this collection does not contain system

iterateBondingSystems

public BondingSystemIterator iterateBondingSystems()
Returns an iterator over all BondingSystems in this collection.

Returns:
an iterator over all BondingSystems in this collection

iterateBondingSystems

public BondingSystemIterator iterateBondingSystems(Atom atom)
Returns an iterator over all BondingSystems in which atom participates.

Parameters:
atom - the Atom
Returns:
an iterator over all BondingSystems in which atom participates

toBondingSystemArray

public BondingSystem[] toBondingSystemArray()
Returns a copy of the bonding systems contained in this collection as an array. The resulting array may be modified without changing the state of this collection.

Returns:
a copy of the bonding system array for this collection

The Octet Molecular Representation Framework v0.8.2