de.jstacs.data.sequences
Class PermutedSequence

java.lang.Object
  extended by de.jstacs.data.Sequence
      extended by de.jstacs.data.sequences.RecursiveSequence
          extended by de.jstacs.data.sequences.PermutedSequence
All Implemented Interfaces:
Comparable<Sequence>

public class PermutedSequence
extends RecursiveSequence

This class is for permuted sequences.

Author:
Jan Grau

Nested Class Summary
 
Nested classes/interfaces inherited from class de.jstacs.data.Sequence
Sequence.CompositeSequence, Sequence.SubSequence
 
Field Summary
 
Fields inherited from class de.jstacs.data.sequences.RecursiveSequence
content
 
Fields inherited from class de.jstacs.data.Sequence
alphabetCon, annotation, rc
 
Constructor Summary
PermutedSequence(Sequence seq)
          Creates a new PermutedSequence by shuffling the symbols of a given Sequence.
 
Method Summary
protected  Sequence flatCloneWithoutAnnotation()
          Works in analogy to Object.clone(), but does not clone the annotation.
protected  int getIndex(int pos)
          Returns the index in the internal sequence.
 int getLength()
          Returns the length of the Sequence.CompositeSequence.
 
Methods inherited from class de.jstacs.data.sequences.RecursiveSequence
continuousVal, discreteVal
 
Methods inherited from class de.jstacs.data.Sequence
annotate, compareTo, complement, complement, create, create, create, equals, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, 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
 

Constructor Detail

PermutedSequence

public PermutedSequence(Sequence seq)
                 throws WrongAlphabetException
Creates a new PermutedSequence by shuffling the symbols of a given Sequence.

Parameters:
seq - the initial sequence
Throws:
WrongAlphabetException - if the AlphabetContainer is not simple
See Also:
RecursiveSequence.RecursiveSequence(de.jstacs.data.AlphabetContainer, Sequence)
Method Detail

getIndex

protected int getIndex(int pos)
Description copied from class: RecursiveSequence
Returns the index in the internal sequence.

Specified by:
getIndex in class RecursiveSequence
Parameters:
pos - the index in the external sequence
Returns:
the index in the internal sequence

getLength

public int getLength()
Description copied from class: Sequence
Returns the length of the Sequence.CompositeSequence.

Specified by:
getLength in class Sequence
Returns:
the length of the Sequence.CompositeSequence

flatCloneWithoutAnnotation

protected Sequence flatCloneWithoutAnnotation()
Description copied from class: Sequence
Works in analogy to Object.clone(), but does not clone the annotation. This method is used in Sequence.annotate(boolean, SequenceAnnotation...).

Specified by:
flatCloneWithoutAnnotation in class Sequence
Returns:
the cloned Sequence.CompositeSequence without annotation