The Octet Molecular Representation Framework v0.8.2

net.sf.octet.model
Class BasicPaddleWheel

java.lang.Object
  extended bynet.sf.octet.model.BasicPaddleWheel
All Implemented Interfaces:
HalfPlaneCollection, PaddleWheel

public class BasicPaddleWheel
extends java.lang.Object
implements PaddleWheel

A default implementation of the PaddleWheel interface.

Author:
Richard Apodaca

Constructor Summary
BasicPaddleWheel(HalfPlaneCollection planes, AtomPair axis)
          Constructs a BasicPaddleWheel from planes and axis.
 
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.
 AtomPair getAxis()
          Returns the AtomPair containing the central Atom as its source and the neighbor Atom as its target.
 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.
 HalfPlaneIterator iterateHalfPlanes(HalfPlane halfPlane)
          Returns an iterator over all HalfPlanes in this PaddleWheel starting from halfPlane in the forward (clockwise) sense.
 HalfPlaneIterator iterateHalfPlanesReverse(HalfPlane halfPlane)
          Returns an iterator over all HalfPlanes in this PaddleWheel starting from halfPlane in the reverse (anticlockwise) sense.
 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

BasicPaddleWheel

public BasicPaddleWheel(HalfPlaneCollection planes,
                        AtomPair axis)
Constructs a BasicPaddleWheel from planes and axis.

Parameters:
planes - the HalfPlaneCollection to use
axis - the axis to use
Throws:
IllegalRepresenationException - if planes has zero elements
Method Detail

getAxis

public AtomPair getAxis()
Description copied from interface: PaddleWheel
Returns the AtomPair containing the central Atom as its source and the neighbor Atom as its target.

Specified by:
getAxis in interface PaddleWheel
Returns:
the AtomPair containing the central Atom as its source and the neighbor Atom as its target

iterateHalfPlanes

public HalfPlaneIterator iterateHalfPlanes(HalfPlane halfPlane)
Description copied from interface: PaddleWheel
Returns an iterator over all HalfPlanes in this PaddleWheel starting from halfPlane in the forward (clockwise) sense.

Specified by:
iterateHalfPlanes in interface PaddleWheel
Parameters:
halfPlane - the HalfPLane at which iteration will begin
Returns:
halfPlane an iterator over all HalfPlanes in this PaddleWheel starting from halfPlane

iterateHalfPlanesReverse

public HalfPlaneIterator iterateHalfPlanesReverse(HalfPlane halfPlane)
Description copied from interface: PaddleWheel
Returns an iterator over all HalfPlanes in this PaddleWheel starting from halfPlane in the reverse (anticlockwise) sense.

Specified by:
iterateHalfPlanesReverse in interface PaddleWheel
Parameters:
halfPlane - the HalfPLane at which iteration will begin
Returns:
halfPlane an iterator over all HalfPlanes in this PaddleWheel starting from halfPlane

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