baobab.bio.permutation
Class SignedReversalBlock

java.lang.Object
  extended by baobab.bio.permutation.ReversalBlock
      extended by baobab.bio.permutation.SignedReversalBlock
All Implemented Interfaces:
java.lang.Comparable

public class SignedReversalBlock
extends ReversalBlock

The SignedReversalBlock class represents an elementary block of a signed permutation, given by its start and end points, which can be used as the breakpoints of a signed reversal

Version:
1.0, May 2006
Author:
Marilia D. V. Braga

Field Summary
static int JOIN_CYCLES
           
static int KEEP_CYCLE
           
static int SPLIT_CYCLE
           
 
Constructor Summary
SignedReversalBlock(SignedPermutation permutation, int start, int end)
          Creates a new block
SignedReversalBlock(SignedPermutation permutation, Point start, Point end)
          Creates a new block
 
Method Summary
 Permutation getPermutation()
          Gets the permutation to which this element belongs
 int getReversalType()
          Gets the type of the reversal represented by this block
 java.lang.String toString()
           
 
Methods inherited from class baobab.bio.permutation.ReversalBlock
compareTo, getEndPoint, getEndPosition, getStartPoint, getStartPosition, isAdjacency, length
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SPLIT_CYCLE

public static final int SPLIT_CYCLE
See Also:
Constant Field Values

KEEP_CYCLE

public static final int KEEP_CYCLE
See Also:
Constant Field Values

JOIN_CYCLES

public static final int JOIN_CYCLES
See Also:
Constant Field Values
Constructor Detail

SignedReversalBlock

public SignedReversalBlock(SignedPermutation permutation,
                           Point start,
                           Point end)
                    throws PermutationException
Creates a new block

Parameters:
permutation - the permutation to which this block belongs
start - the start Point of this block in the permutation
end - the end Point of this block in the permutation
Throws:
PermutationException

SignedReversalBlock

public SignedReversalBlock(SignedPermutation permutation,
                           int start,
                           int end)
Creates a new block

Parameters:
permutation - the permutation to which this block belongs
start - the start position of this block in the permutation
end - the end position of this block in the permutation
Method Detail

getReversalType

public int getReversalType()
Gets the type of the reversal represented by this block

Returns:
SPLIT_CYCLE, KEEP_CYCLE or JOIN_CYCLES as an int

toString

public java.lang.String toString()
Overrides:
toString in class ReversalBlock

getPermutation

public Permutation getPermutation()
Gets the permutation to which this element belongs

Returns:
the permutation to which this element belongs