The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Interface OrbitalCollection

All Known Subinterfaces:
NonbondingShell
All Known Implementing Classes:
BasicNonbondingShell, BasicOrbitalCollection

public interface OrbitalCollection

An immutable group of Orbitals. Any Orbital may be present, but null is disallowed. Orbitals from different Molecules may or not be present, depending on implementation.

OrbitalCollection places the additional restriction on implementors that all methods are consistent - they can be assumed to return the same results throughout the lifetime of the OrbitalCollection.

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

Method Summary
 boolean containsOrbital(Orbital orbital)
          Returns true if the specified Orbital is contained in this collection, and false otherwise.
 int countOrbitals()
          Returns the number of Orbitals contained in this Orbital collection.
 Orbital getOrbital(int index)
          Returns the Orbital located at the specified zero-based index.
 int getOrbitalIndex(Orbital orbital)
          Returns the zero-based index of the specified Orbital.
 OrbitalIterator iterateOrbitals()
          Returns an iterator over all Orbitals in this collection.
 Orbital[] toOrbitalArray()
          Returns a copy of the Orbitals contained in this collection as an array.
 

Method Detail

containsOrbital

public boolean containsOrbital(Orbital orbital)
Returns true if the specified Orbital is contained in this collection, and false otherwise.

Parameters:
orbital - the Orbital
Returns:
true if contained, false otherwise

countOrbitals

public int countOrbitals()
Returns the number of Orbitals contained in this Orbital collection.

Returns:
the number of Orbitals in this collection

getOrbitalIndex

public int getOrbitalIndex(Orbital orbital)
Returns the zero-based index of the specified Orbital.

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

getOrbital

public Orbital getOrbital(int index)
Returns the Orbital located at the specified zero-based index.

Parameters:
index - the index
Returns:
the Orbital at index, or null if the index is invalid
Throws:
java.lang.IndexOutOfBoundsException - if index is less than zero or greater than or equal to the number of Orbitals

iterateOrbitals

public OrbitalIterator iterateOrbitals()
Returns an iterator over all Orbitals in this collection.

Returns:
an iterator over all Orbitals in this collection

toOrbitalArray

public Orbital[] toOrbitalArray()
Returns a copy of the Orbitals 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 Orbital array for this collection

The Octet Molecular Representation Framework v0.8.2