The Octet Molecular Representation Framework v0.8.2

net.sf.octet.collection
Class BasicGammaSequenceCollection

java.lang.Object
  extended bynet.sf.octet.collection.BasicGammaSequenceCollection
All Implemented Interfaces:
GammaSequenceCollection

public class BasicGammaSequenceCollection
extends java.lang.Object
implements GammaSequenceCollection

A default implementation of the GammaSequenceCollection interface backed by an ArraySequence.

Author:
Richard Apodaca

Constructor Summary
BasicGammaSequenceCollection()
          Constructs an empty BasicGammaSequenceCollection.
BasicGammaSequenceCollection(java.util.Collection sequences)
           
BasicGammaSequenceCollection(GammaSequence[] 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.
 int countGammaSequences()
          Returns the number of GammaSequences 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.
 int getGammaSequenceIndex(GammaSequence sequence)
          Returns the zero-based index of the specified GammaSequence.
 GammaSequenceIterator iterateGammaSequences()
          Returns an iterator over all GammaSequences in this collection.
 GammaSequence[] toGammaSequenceArray()
          Returns a copy of the GammaSequences 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

BasicGammaSequenceCollection

public BasicGammaSequenceCollection()
Constructs an empty BasicGammaSequenceCollection.


BasicGammaSequenceCollection

public BasicGammaSequenceCollection(GammaSequence[] sequences)

BasicGammaSequenceCollection

public BasicGammaSequenceCollection(java.util.Collection sequences)
Method Detail

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

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

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

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

The Octet Molecular Representation Framework v0.8.2