The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Class BasicHalfPlaneCollection

java.lang.Object
  extended bynet.sf.octet.collection.BasicHalfPlaneCollection
All Implemented Interfaces:
HalfPlaneCollection

public class BasicHalfPlaneCollection
extends java.lang.Object
implements HalfPlaneCollection

A default implementation of the HalfPlaneCollection interface backed by an ArraySequence

Author:
Richard Apodaca

Constructor Summary
BasicHalfPlaneCollection()
          Constructs an empty BasicHalfPlaneCollection
BasicHalfPlaneCollection(java.util.Collection planes)
          Constructs a BasicHalfPlaneCollection from the elements contained in planes.
BasicHalfPlaneCollection(HalfPlane[] planes)
          Constructs a BasicHalfPlaneCollection from the elements contained in planes.
 
Method Summary
 boolean containsHalfPlane(HalfPlane halfPlane)
          Returns true if the specified HalfPlane is contained in this collection, and false otherwise.
 int countHalfPlanes()
          Returns the number of HalfPlanes contained in this HalfPlane collection.
 HalfPlane getHalfPlane(int index)
          Returns the HalfPlane located at the specified zero-based index.
 int getHalfPlaneIndex(HalfPlane halfPlane)
          Returns the zero-based index of the specified Atom.
 HalfPlaneIterator iterateHalfPlanes()
          Returns an iterator over all HalfPlanes in this collection.
 HalfPlane[] toHalfPlaneArray()
          Returns a copy of the HalfPlanes 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

BasicHalfPlaneCollection

public BasicHalfPlaneCollection()
Constructs an empty BasicHalfPlaneCollection


BasicHalfPlaneCollection

public BasicHalfPlaneCollection(java.util.Collection planes)
Constructs a BasicHalfPlaneCollection from the elements contained in planes.

Parameters:
planes - the collection from which to get HalfPlanes
Throws:
java.lang.IllegalArgumentException - if planes contains Objects that do not implement HalfPlane
java.lang.NullPointerException - if planes contains null

BasicHalfPlaneCollection

public BasicHalfPlaneCollection(HalfPlane[] planes)
Constructs a BasicHalfPlaneCollection from the elements contained in planes.

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

containsHalfPlane

public boolean containsHalfPlane(HalfPlane halfPlane)
Description copied from interface: HalfPlaneCollection
Returns true if the specified HalfPlane is contained in this collection, and false otherwise.

Specified by:
containsHalfPlane in interface HalfPlaneCollection
Parameters:
halfPlane - the HalfPlane
Returns:
true if contained, false otherwise

countHalfPlanes

public int countHalfPlanes()
Description copied from interface: HalfPlaneCollection
Returns the number of HalfPlanes contained in this HalfPlane collection.

Specified by:
countHalfPlanes in interface HalfPlaneCollection
Returns:
the number of HalfPlanes in this collection

getHalfPlaneIndex

public int getHalfPlaneIndex(HalfPlane halfPlane)
Description copied from interface: HalfPlaneCollection
Returns the zero-based index of the specified Atom.

Specified by:
getHalfPlaneIndex in interface HalfPlaneCollection
Parameters:
halfPlane - the halfPlane
Returns:
the index of the HalfPlane, or -1 if this collection does not contain halfPlane

getHalfPlane

public HalfPlane getHalfPlane(int index)
Description copied from interface: HalfPlaneCollection
Returns the HalfPlane located at the specified zero-based index.

Specified by:
getHalfPlane in interface HalfPlaneCollection
Parameters:
index - the index
Returns:
the HalfPlane at index, or null if the index is invalid

iterateHalfPlanes

public HalfPlaneIterator iterateHalfPlanes()
Description copied from interface: HalfPlaneCollection
Returns an iterator over all HalfPlanes in this collection.

Specified by:
iterateHalfPlanes in interface HalfPlaneCollection
Returns:
an iterator over all HalfPlanes in this collection

toHalfPlaneArray

public HalfPlane[] toHalfPlaneArray()
Description copied from interface: HalfPlaneCollection
Returns a copy of the HalfPlanes contained in this collection as an array. The resulting array may be modified without changing the state of this collection.

Specified by:
toHalfPlaneArray in interface HalfPlaneCollection
Returns:
a copy of the HalfPlane array for this collection

The Octet Molecular Representation Framework v0.8.2