de.jstacs.data.sequences
Class RecursiveSequence

java.lang.Object
  extended by de.jstacs.data.Sequence
      extended by de.jstacs.data.sequences.RecursiveSequence
All Implemented Interfaces:
Comparable<Sequence>
Direct Known Subclasses:
PermutedSequence, Sequence.CompositeSequence, Sequence.SubSequence

public abstract class RecursiveSequence
extends Sequence

This is the main class for subsequences, composite sequences, ... . All these sequences are defined on an existing sequence.

Author:
Jens Keilwagen

Nested Class Summary
 
Nested classes/interfaces inherited from class de.jstacs.data.Sequence
Sequence.CompositeSequence, Sequence.SubSequence
 
Field Summary
protected  Sequence content
          The internal sequence
 
Fields inherited from class de.jstacs.data.Sequence
alphabetCon, annotation, rc
 
Constructor Summary
RecursiveSequence(AlphabetContainer alphabet, Sequence seq)
          This constructor creates a recursive sequence using the annotation of the given sequence.
RecursiveSequence(AlphabetContainer alphabet, SequenceAnnotation[] annotation, Sequence seq)
          This constructor creates a recursive sequence.
 
Method Summary
 double continuousVal(int pos)
          Returns the continuous value of position pos.
 int discreteVal(int pos)
          Returns the discrete value of position pos.
protected abstract  int getIndex(int pos)
          Return the index in the internal sequence
 
Methods inherited from class de.jstacs.data.Sequence
annotate, compareTo, complement, complement, create, create, create, equals, flatCloneWithoutAnnotation, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getLength, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, reverse, reverse, reverseComplement, reverseComplement, toDiscrete, toString, toString, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

content

protected Sequence content
The internal sequence

Constructor Detail

RecursiveSequence

public RecursiveSequence(AlphabetContainer alphabet,
                         SequenceAnnotation[] annotation,
                         Sequence seq)
This constructor creates a recursive sequence.

Parameters:
alphabet - the AlphabetContainer
annotation - the annotation of the recursive sequence
seq - the sequence

RecursiveSequence

public RecursiveSequence(AlphabetContainer alphabet,
                         Sequence seq)
This constructor creates a recursive sequence using the annotation of the given sequence.

Parameters:
alphabet - the AlphabetContainer
seq - the sequence
Method Detail

continuousVal

public final double continuousVal(int pos)
Description copied from class: Sequence
Returns the continuous value of position pos.

Specified by:
continuousVal in class Sequence
Parameters:
pos - the position
Returns:
the continuous value of position pos

discreteVal

public final int discreteVal(int pos)
Description copied from class: Sequence
Returns the discrete value of position pos.

Specified by:
discreteVal in class Sequence
Parameters:
pos - the position
Returns:
the discrete value of position pos

getIndex

protected abstract int getIndex(int pos)
Return the index in the internal sequence

Parameters:
pos - the index in the external sequence
Returns:
the index in the internal sequence