baobab.bio.permutation
Class BPGraphTranspositionBlock

java.lang.Object
  extended by baobab.bio.permutation.BPGraphReversalBlock
      extended by baobab.bio.permutation.BPGraphTranspositionBlock
All Implemented Interfaces:
java.lang.Comparable

public class BPGraphTranspositionBlock
extends BPGraphReversalBlock

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

Author:
Marilia D. V. Braga

Constructor Summary
BPGraphTranspositionBlock(PermutationBPGraph permutation, BPGraphPoint start, BPGraphPoint middle, BPGraphPoint end)
          Creates a new block
BPGraphTranspositionBlock(PermutationBPGraph permutation, int start, int middle, int end)
          Creates a new block
 
Method Summary
 int compareTo(java.lang.Object object)
          Compares this block to another block
 BPGraphPoint getMiddlePoint()
          Gets the middle point of this block
 int getMiddlePosition()
          Gets the middle point of this block
 PermutationBPGraph getPermutationBPGraph()
          Gets the permutation breakpoint graph to which this element belongs
 int[] toIntArray()
          Gets a representation of the block as an array of int, with size 3, representing its start, middle and end positions
 
Methods inherited from class baobab.bio.permutation.BPGraphReversalBlock
getEndPoint, getEndPosition, getStartPoint, getStartPosition, isAdjacency, length, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BPGraphTranspositionBlock

public BPGraphTranspositionBlock(PermutationBPGraph permutation,
                                 BPGraphPoint start,
                                 BPGraphPoint middle,
                                 BPGraphPoint 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

BPGraphTranspositionBlock

public BPGraphTranspositionBlock(PermutationBPGraph permutation,
                                 int start,
                                 int middle,
                                 int end)
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
Method Detail

getMiddlePoint

public BPGraphPoint getMiddlePoint()
Gets the middle point of this block

Returns:
the middle point

getMiddlePosition

public int getMiddlePosition()
Gets the middle point of this block

Returns:
the middle point

toIntArray

public int[] toIntArray()
Gets a representation of the block as an array of int, with size 3, representing its start, middle and end positions

Returns:
representation of the block as an array of int

compareTo

public int compareTo(java.lang.Object object)
Compares this block to another block

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class BPGraphReversalBlock
Parameters:
object - the other block
Returns:
the result of the comparison, as an int

getPermutationBPGraph

public PermutationBPGraph getPermutationBPGraph()
Gets the permutation breakpoint graph to which this element belongs

Returns:
the breakpoint graph to which this element belongs