The Octet Molecular Representation Framework v0.8.2

net.sf.octet.model
Class BasicConfiguration

java.lang.Object
  extended bynet.sf.octet.model.BasicConfiguration
All Implemented Interfaces:
Configuration, PaddleWheelCollection

public class BasicConfiguration
extends java.lang.Object
implements Configuration

A default implementation of the Configuration interface.

Author:
Richard Apodaca

Constructor Summary
BasicConfiguration(PaddleWheelCollection wheels)
          Constructs a BasicConfiguration from the contents of 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.
static Configuration getNullInstance()
          Returns a singleton Configuration instance that contains no PaddleWheels.
 PaddleWheel getPaddleWheel(Atom neighbor)
          Returns the PaddleWheel directed at neighbor.
 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

BasicConfiguration

public BasicConfiguration(PaddleWheelCollection wheels)
Constructs a BasicConfiguration from the contents of wheels.

Throws:
IllegalRepresentationException - if a valid Configuration can not be constructed from wheels
Method Detail

getPaddleWheel

public PaddleWheel getPaddleWheel(Atom neighbor)
Description copied from interface: Configuration
Returns the PaddleWheel directed at neighbor.

Specified by:
getPaddleWheel in interface Configuration
Parameters:
neighbor - the Atom to which the returned PaddleWheel is directed
Returns:
the PaddleWheel directed toward neighbor

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

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

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

getNullInstance

public static Configuration getNullInstance()
Returns a singleton Configuration instance that contains no PaddleWheels. Because it has no state, this instance can be shared in representations that have no atomic Configuration as part of the "Null Object" and "Flyweight" patterns.

Returns:
a singleton Configuration instance that contains no PaddleWheels

The Octet Molecular Representation Framework v0.8.2