The Octet Molecular Representation Framework v0.8.2

net.sf.octet.model
Class BasicConformation

java.lang.Object
  extended bynet.sf.octet.model.BasicConformation
All Implemented Interfaces:
Conformation, GammaSequenceCollection, PaddleWheelCollection

public class BasicConformation
extends java.lang.Object
implements Conformation

A default implementation of the Conformation interface.

Author:
Richard Apodaca

Constructor Summary
BasicConformation(PaddleWheelCollection wheels, GammaSequenceCollection sequences)
          Constructs a BasicConformation from wheels and sequences.
 
Method Summary
 boolean containsGammaSequence(Atom source, Atom target)
          Returns true if a GammaSequence containing an axis with source as its source and target as its target can be found, or false otherwise.
 boolean containsGammaSequence(GammaSequence sequence)
          Returns true if the specified GammaSequence is contained in this collection, and false otherwise.
 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 countGammaSequences()
          Returns the number of GammaSequences contained in this collection.
 int countPaddleWheels()
          Returns the number of PaddleWheels contained in this collection.
 GammaSequence getGammaSequence(Atom source, Atom target)
          Returns the GammaSequence having source and target axis Atoms.
 GammaSequence getGammaSequence(int index)
          Returns the GammaSequence located at the specified zero-based index.
 GammaSequence getGammaSequence(PaddleWheel wheel)
          Returns the GammaSequence associated with the specified PaddleWheel.
 int getGammaSequenceIndex(GammaSequence sequence)
          Returns the zero-based index of the specified GammaSequence.
static Conformation getNullInstance()
           
 PaddleWheel getPaddleWheel(Atom source, Atom target)
          Returns the PaddleWheel containing an axis that consists of source and target.
 PaddleWheel getPaddleWheel(GammaSequence sequence)
          Returns the PaddleWheel associated with the specified GammaSequence.
 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.
 GammaSequenceIterator iterateGammaSequences()
          Returns an iterator over all GammaSequences in this collection.
 PaddleWheelIterator iteratePaddleWheels()
          Returns an iterator over all PaddleWheels in this collection.
 GammaSequence[] toGammaSequenceArray()
          Returns a copy of the GammaSequences contained in this collection as an array.
 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

BasicConformation

public BasicConformation(PaddleWheelCollection wheels,
                         GammaSequenceCollection sequences)
Constructs a BasicConformation from wheels and sequences.

Parameters:
wheels - the PaddleWheelCollection to be used
sequences - the GammaSequenceCollection to be used
Throws:
IllegalRepresentationException - if the number of elements in wheels and sequences differs
Method Detail

getPaddleWheel

public PaddleWheel getPaddleWheel(GammaSequence sequence)
Description copied from interface: Conformation
Returns the PaddleWheel associated with the specified GammaSequence.

Specified by:
getPaddleWheel in interface Conformation
Parameters:
sequence - the GammaSequence to search
Returns:
the PaddleWheel associated with sequence

getGammaSequence

public GammaSequence getGammaSequence(PaddleWheel wheel)
Description copied from interface: Conformation
Returns the GammaSequence associated with the specified PaddleWheel.

Specified by:
getGammaSequence in interface Conformation
Parameters:
wheel - the PaddleWheel to search
Returns:
the GammaSequence associated with wheel

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

containsGammaSequence

public boolean containsGammaSequence(GammaSequence sequence)
Description copied from interface: GammaSequenceCollection
Returns true if the specified GammaSequence is contained in this collection, and false otherwise.

Specified by:
containsGammaSequence in interface GammaSequenceCollection
Parameters:
sequence - the PaddleWheel
Returns:
true if contained, false otherwise

countGammaSequences

public int countGammaSequences()
Description copied from interface: GammaSequenceCollection
Returns the number of GammaSequences contained in this collection.

Specified by:
countGammaSequences in interface GammaSequenceCollection
Returns:
the number of GammaSequences in this collection

getGammaSequenceIndex

public int getGammaSequenceIndex(GammaSequence sequence)
Description copied from interface: GammaSequenceCollection
Returns the zero-based index of the specified GammaSequence.

Specified by:
getGammaSequenceIndex in interface GammaSequenceCollection
Parameters:
sequence - the GammaSequence
Returns:
the index of the GammaSequence, or -1 if this collection does not contain sequence

getGammaSequence

public GammaSequence getGammaSequence(int index)
Description copied from interface: GammaSequenceCollection
Returns the GammaSequence located at the specified zero-based index.

Specified by:
getGammaSequence in interface GammaSequenceCollection
Parameters:
index - the index
Returns:
the GammaSequence at index, or null if the index is invalid

getGammaSequence

public GammaSequence getGammaSequence(Atom source,
                                      Atom target)
Description copied from interface: GammaSequenceCollection
Returns the GammaSequence having source and target axis Atoms.

Specified by:
getGammaSequence in interface GammaSequenceCollection
Parameters:
source - the source Atom
target - the target Atom
Returns:
the GammaSequence having source and target as axis Atoms

containsGammaSequence

public boolean containsGammaSequence(Atom source,
                                     Atom target)
Description copied from interface: GammaSequenceCollection
Returns true if a GammaSequence containing an axis with source as its source and target as its target can be found, or false otherwise.

Specified by:
containsGammaSequence in interface GammaSequenceCollection
Parameters:
source - the axis source Atom
target - the axid target Atom
Returns:
true if the GammaSequence was found, or false otherwise

iterateGammaSequences

public GammaSequenceIterator iterateGammaSequences()
Description copied from interface: GammaSequenceCollection
Returns an iterator over all GammaSequences in this collection.

Specified by:
iterateGammaSequences in interface GammaSequenceCollection
Returns:
an iterator over all GammaSequences in this collection

toGammaSequenceArray

public GammaSequence[] toGammaSequenceArray()
Description copied from interface: GammaSequenceCollection
Returns a copy of the GammaSequences contained in this collection as an array. The resulting array may be modified without changing the state of this collection.

Specified by:
toGammaSequenceArray in interface GammaSequenceCollection
Returns:
a copy of the GammaSequence array for this collection

getNullInstance

public static Conformation getNullInstance()

The Octet Molecular Representation Framework v0.8.2