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

Class for a permuted sequence.

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)
          This constructor creates an instance by shuffling the symbols.
 
Method Summary
protected  Sequence flatCloneWithoutAnnotation()
          Works in analogy to Object.clone(), but does not clone the annotation.
protected  int getIndex(int pos)
          Return the index in the internal sequence
 int getLength()
          Returns the length of the sequence
 
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
This constructor creates an instance by shuffling the symbols.

Parameters:
seq - the initial sequence
Throws:
WrongAlphabetException - if the alphabetConatiner is not simple
Method Detail

getIndex

protected int getIndex(int pos)
Description copied from class: RecursiveSequence
Return 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

Specified by:
getLength in class Sequence
Returns:
the length

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