The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Interface ElectronCollection

All Known Subinterfaces:
NonbondingShell, Orbital
All Known Implementing Classes:
BasicElectronCollection, BasicNonbondingShell, BasicOrbital

public interface ElectronCollection

ElectronCollection represents an immutable group of Electrons. Any Electron may be present, but null is disallowed. Electrons from different Molecules may or not be present, depending on implementation.

ElectronCollection 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 Electronollection.

Author:
Richard Apodaca

Method Summary
 boolean containsElectron(Electron electron)
          Returns true if the specified Electron is contained in this collection, and false otherwise.
 int countElectrons()
          Returns the number of Electrons contained in this collection.
 Electron getElectron(int index)
          Returns the Electron located at the specified zero-based index.
 int getElectronIndex(Electron electron)
          Returns the zero-based index of the specified Electron.
 ElectronIterator iterateElectrons()
          Returns an iterator over all Electrons in this collection.
 Electron[] toElectronArray()
          Returns a copy of the Electrons contained in this collection as an array.
 

Method Detail

containsElectron

public boolean containsElectron(Electron electron)
Returns true if the specified Electron is contained in this collection, and false otherwise.

Parameters:
electron - the Electron
Returns:
true if contained, false otherwise

countElectrons

public int countElectrons()
Returns the number of Electrons contained in this collection.

Returns:
the number of Electrons in this collection

getElectronIndex

public int getElectronIndex(Electron electron)
Returns the zero-based index of the specified Electron.

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

getElectron

public Electron getElectron(int index)
Returns the Electron located at the specified zero-based index.

Parameters:
index - the index
Returns:
the Electron 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 Electrons

iterateElectrons

public ElectronIterator iterateElectrons()
Returns an iterator over all Electrons in this collection.

Returns:
an iterator over all Electrons in this collection

toElectronArray

public Electron[] toElectronArray()
Returns a copy of the Electrons 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 Electron array for this collection

The Octet Molecular Representation Framework v0.8.2