baobab.bio.permutation
Class BPGraphReversalBlock

java.lang.Object
  extended by baobab.bio.permutation.BPGraphReversalBlock
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
BPGraphTranspositionBlock, SignedBPGraphReversalBlock

public class BPGraphReversalBlock
extends java.lang.Object
implements java.lang.Comparable

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

Author:
Marilia D. V. Braga

Constructor Summary
BPGraphReversalBlock(PermutationBPGraph permutation, BPGraphPoint start, BPGraphPoint end)
          Creates a new block
BPGraphReversalBlock(PermutationBPGraph permutation, int start, int end)
          Creates a new block
 
Method Summary
 int compareTo(java.lang.Object object)
          Compares this block to another block
 BPGraphPoint getEndPoint()
          Gets the end point of this block in the permutation
 int getEndPosition()
          Gets the end position of this block in the permutation
 PermutationBPGraph getPermutationBPGraph()
          Gets the permutation breakpoint graph to which this element belongs
 BPGraphPoint getStartPoint()
          Gets the start point of this block in the permutation
 int getStartPosition()
          Gets the start position of this block in the permutation
 boolean isAdjacency()
          Tests whether this block is an adjacency
 int length()
          Gets the length of the block (the number of values of the permutation between its start and end points)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BPGraphReversalBlock

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

BPGraphReversalBlock

public BPGraphReversalBlock(PermutationBPGraph 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

length

public int length()
Gets the length of the block (the number of values of the permutation between its start and end points)

Returns:
the length

isAdjacency

public boolean isAdjacency()
Tests whether this block is an adjacency

Returns:
true/false

getStartPoint

public BPGraphPoint getStartPoint()
Gets the start point of this block in the permutation

Returns:
the start point

getEndPoint

public BPGraphPoint getEndPoint()
Gets the end point of this block in the permutation

Returns:
the end point

getStartPosition

public int getStartPosition()
Gets the start position of this block in the permutation

Returns:
the start position

getEndPosition

public int getEndPosition()
Gets the end position of this block in the permutation

Returns:
the end position

toString

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

compareTo

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

Specified by:
compareTo in interface java.lang.Comparable
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