The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Class BasicBondingSystemCollection

java.lang.Object
  extended bynet.sf.octet.collection.BasicBondingSystemCollection
All Implemented Interfaces:
BondingSystemCollection

public class BasicBondingSystemCollection
extends java.lang.Object
implements BondingSystemCollection

A default implementation of the BondingSystemCollection interface backed by an ArraySequence.

Author:
Richard Apodaca

Constructor Summary
BasicBondingSystemCollection()
          Constructs an empty, fully functional BasicBondingSystemCollection.
BasicBondingSystemCollection(BondingSystem[] systems)
          Constructs a BasicBondingSystemCollection from the elements contained in systems.
BasicBondingSystemCollection(java.util.Collection systems)
          Constructs a BasicBondingSystemCollection from the elements contained in systems.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicBondingSystemCollection

public BasicBondingSystemCollection()
Constructs an empty, fully functional BasicBondingSystemCollection.


BasicBondingSystemCollection

public BasicBondingSystemCollection(java.util.Collection systems)
Constructs a BasicBondingSystemCollection from the elements contained in systems.

Parameters:
systems - the collection from which to get BondingSystems
Throws:
java.lang.IllegalArgumentException - if systems contains Objects that do not implement BondingSystem
java.lang.NullPointerException - if systems contains null

BasicBondingSystemCollection

public BasicBondingSystemCollection(BondingSystem[] systems)
Constructs a BasicBondingSystemCollection from the elements contained in systems.

Parameters:
systems - the array from which to get BondingSystems
Throws:
java.lang.IllegalArgumentException - if systems contains Objects that do not implement BondingSystem
java.lang.NullPointerException - if systems contains null
Method Detail

countBondingSystems

public int countBondingSystems(Atom atom)
Description copied from interface: BondingSystemCollection
Returns the number of BondingSystems in this collection in which atom participates.

Specified by:
countBondingSystems in interface BondingSystemCollection
Parameters:
atom - the Atom
Returns:
the number of BondingSystems in this collection in which atom participates

iterateBondingSystems

public BondingSystemIterator iterateBondingSystems(Atom atom)
Description copied from interface: BondingSystemCollection
Returns an iterator over all BondingSystems in which atom participates.

Specified by:
iterateBondingSystems in interface BondingSystemCollection
Parameters:
atom - the Atom
Returns:
an iterator over all BondingSystems in which atom participates

containsBondingSystem

public boolean containsBondingSystem(BondingSystem system)
Description copied from interface: BondingSystemCollection
Returns true if a BondingSystem matching system is contained in this collection.

Specified by:
containsBondingSystem in interface BondingSystemCollection
Parameters:
system - the BondingSystem to search for
Returns:
true if found, false otherwise

countBondingSystems

public int countBondingSystems()
Description copied from interface: BondingSystemCollection
Returns the number of BondingSystems contained in this collection.

Specified by:
countBondingSystems in interface BondingSystemCollection
Returns:
the number of BondingSystems contained in this collection.

iterateBondingSystems

public BondingSystemIterator iterateBondingSystems()
Description copied from interface: BondingSystemCollection
Returns an iterator over all BondingSystems in this collection.

Specified by:
iterateBondingSystems in interface BondingSystemCollection
Returns:
an iterator over all BondingSystems in this collection

getBondingSystem

public BondingSystem getBondingSystem(int index)
Description copied from interface: BondingSystemCollection
Returns the BondingSystem located at the specified zero-based index.

Specified by:
getBondingSystem in interface BondingSystemCollection
Parameters:
index - the index
Returns:
the BondingSystem at index

getBondingSystemIndex

public int getBondingSystemIndex(BondingSystem system)
Description copied from interface: BondingSystemCollection
Returns the zero-based index of the specified BondingSystem.

Specified by:
getBondingSystemIndex in interface BondingSystemCollection
Parameters:
system - the BondingSystem
Returns:
the index of the BondingSystem, or -1 if this collection does not contain system

toBondingSystemArray

public BondingSystem[] toBondingSystemArray()
Description copied from interface: BondingSystemCollection
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.

Specified by:
toBondingSystemArray in interface BondingSystemCollection
Returns:
a copy of the bonding system array for this collection

The Octet Molecular Representation Framework v0.8.2