jebl.evolution.alignments
Class BasicAlignment

java.lang.Object
  extended by jebl.evolution.alignments.BasicAlignment
All Implemented Interfaces:
Alignment, Patterns, Sequences

public class BasicAlignment
extends Object
implements Alignment

A basic implementation of the Alignment interface.

Author:
Andrew Rambaut, Alexei Drummond

Constructor Summary
BasicAlignment()
          Constructs a basic alignment with no sequences.
BasicAlignment(Collection<? extends Sequence> sequences)
          Constructs a basic alignment from a collection of sequences.
BasicAlignment(Sequence[] sequences)
          Constructs a basic alignment from an array of sequences.
 
Method Summary
 void addSequence(Sequence sequence)
          Adds a sequence to this alignment
 int getPatternCount()
           
 int getPatternLength()
           
 List<Pattern> getPatterns()
          Get a list of all the patterns
 Sequence getSequence(Taxon taxon)
           
 List<Sequence> getSequenceList()
           
 Set<Sequence> getSequences()
           
 SequenceType getSequenceType()
           
 int getSiteCount()
           
 List<Taxon> getTaxa()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAlignment

public BasicAlignment()
Constructs a basic alignment with no sequences.


BasicAlignment

public BasicAlignment(Collection<? extends Sequence> sequences)
Constructs a basic alignment from a collection of sequences. The sequence objects are not copied.

Parameters:
sequences -

BasicAlignment

public BasicAlignment(Sequence[] sequences)
Constructs a basic alignment from an array of sequences. The sequence objects are not copied.

Parameters:
sequences -
Method Detail

getSequences

public Set<Sequence> getSequences()
Specified by:
getSequences in interface Sequences
Returns:
a set containing all the sequences in this alignment.

getSequenceList

public List<Sequence> getSequenceList()
Specified by:
getSequenceList in interface Alignment

getSequenceType

public SequenceType getSequenceType()
Specified by:
getSequenceType in interface Patterns
Returns:
the data type of the states in these site patterns.

getSequence

public Sequence getSequence(Taxon taxon)
Specified by:
getSequence in interface Sequences

getSiteCount

public int getSiteCount()
Specified by:
getSiteCount in interface Alignment

getPatternCount

public int getPatternCount()
Specified by:
getPatternCount in interface Patterns

getPatternLength

public int getPatternLength()
Specified by:
getPatternLength in interface Patterns

getPatterns

public List<Pattern> getPatterns()
Description copied from interface: Patterns
Get a list of all the patterns

Specified by:
getPatterns in interface Patterns
Returns:
the list

getTaxa

public List<Taxon> getTaxa()
Specified by:
getTaxa in interface Patterns
Returns:
the list of taxa that the state values correspond to.

addSequence

public void addSequence(Sequence sequence)
Adds a sequence to this alignment

Parameters:
sequence - the new sequence.