The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Class BasicPaddleWheelCollection

java.lang.Object
  extended bynet.sf.octet.collection.BasicPaddleWheelCollection
All Implemented Interfaces:
PaddleWheelCollection

public class BasicPaddleWheelCollection
extends java.lang.Object
implements PaddleWheelCollection

A default implementation of the PaddleWheelCollection interface backed by an ArraySequence

Author:
Richard Apodaca

Constructor Summary
BasicPaddleWheelCollection()
          Constructs an empty, fully functional BasicPaddleWheelCollection.
BasicPaddleWheelCollection(java.util.Collection wheels)
          Constructs a BasicPaddleWheelCollection from the elements contained in wheels.
BasicPaddleWheelCollection(PaddleWheel[] wheels)
          Constructs a BasicPaddleWheelCollection from the elements contained in wheels.
 
Method Summary
 boolean containsPaddleWheel(Atom source, Atom target)
          Returns true if a PaddleWheel can be found containing an axis with source as its source and target as its target.
 boolean containsPaddleWheel(PaddleWheel paddleWheel)
          Returns true if the specified PaddleWheel is contained in this collection, and false otherwise.
 int countPaddleWheels()
          Returns the number of PaddleWheels contained in this collection.
 PaddleWheel getPaddleWheel(Atom source, Atom target)
          Returns the PaddleWheel containing an axis that consists of source and target.
 PaddleWheel getPaddleWheel(int index)
          Returns the PaddleWheel located at the specified zero-based index.
 int getPaddleWheelIndex(PaddleWheel paddleWheel)
          Returns the zero-based index of the specified PaddleWheel.
 PaddleWheelIterator iteratePaddleWheels()
          Returns an iterator over all PaddleWheels in this collection.
 PaddleWheel[] toPaddleWheelArray()
          Returns a copy of the PaddleWheels 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

BasicPaddleWheelCollection

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


BasicPaddleWheelCollection

public BasicPaddleWheelCollection(java.util.Collection wheels)
Constructs a BasicPaddleWheelCollection from the elements contained in wheels.

Parameters:
wheels - the collection from which to get PaddleWheels
Throws:
java.lang.IllegalArgumentException - if wheels contains Objects that do not implement PaddleWheel
java.lang.NullPointerException - if wheels contains null

BasicPaddleWheelCollection

public BasicPaddleWheelCollection(PaddleWheel[] wheels)
Constructs a BasicPaddleWheelCollection from the elements contained in wheels.

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

containsPaddleWheel

public boolean containsPaddleWheel(PaddleWheel paddleWheel)
Description copied from interface: PaddleWheelCollection
Returns true if the specified PaddleWheel is contained in this collection, and false otherwise.

Specified by:
containsPaddleWheel in interface PaddleWheelCollection
Parameters:
paddleWheel - the PaddleWheel
Returns:
true if contained, false otherwise

countPaddleWheels

public int countPaddleWheels()
Description copied from interface: PaddleWheelCollection
Returns the number of PaddleWheels contained in this collection.

Specified by:
countPaddleWheels in interface PaddleWheelCollection
Returns:
the number of PaddleWheels in this collection

getPaddleWheelIndex

public int getPaddleWheelIndex(PaddleWheel paddleWheel)
Description copied from interface: PaddleWheelCollection
Returns the zero-based index of the specified PaddleWheel.

Specified by:
getPaddleWheelIndex in interface PaddleWheelCollection
Parameters:
paddleWheel - the PaddleWheel
Returns:
the index of the PaddleWheel, or -1 if this collection does not contain paddleWheel

getPaddleWheel

public PaddleWheel getPaddleWheel(int index)
Description copied from interface: PaddleWheelCollection
Returns the PaddleWheel located at the specified zero-based index.

Specified by:
getPaddleWheel in interface PaddleWheelCollection
Parameters:
index - the index
Returns:
the PaddleWheel at index, or null if the index is invalid

iteratePaddleWheels

public PaddleWheelIterator iteratePaddleWheels()
Description copied from interface: PaddleWheelCollection
Returns an iterator over all PaddleWheels in this collection.

Specified by:
iteratePaddleWheels in interface PaddleWheelCollection
Returns:
an iterator over all PaddleWheels in this collection

toPaddleWheelArray

public PaddleWheel[] toPaddleWheelArray()
Description copied from interface: PaddleWheelCollection
Returns a copy of the PaddleWheels contained in this collection as an array. The resulting array may be modified without changing the state of this collection.

Specified by:
toPaddleWheelArray in interface PaddleWheelCollection
Returns:
a copy of the PaddleWheel array for this collection

containsPaddleWheel

public boolean containsPaddleWheel(Atom source,
                                   Atom target)
Description copied from interface: PaddleWheelCollection
Returns true if a PaddleWheel can be found containing an axis with source as its source and target as its target.

Specified by:
containsPaddleWheel in interface PaddleWheelCollection
Parameters:
source - the source Atom of the axis
target - the target Atom of the axis
Returns:
true if the PaddleWheel could be found, or false otherwise

getPaddleWheel

public PaddleWheel getPaddleWheel(Atom source,
                                  Atom target)
Description copied from interface: PaddleWheelCollection
Returns the PaddleWheel containing an axis that consists of source and target.

Specified by:
getPaddleWheel in interface PaddleWheelCollection
Parameters:
source - the source Atom
target - the target Atom
Returns:
the PaddleWheel accociated with the GammaSequence having source and target as endpoints

The Octet Molecular Representation Framework v0.8.2