baobab.bio.permutation
Class SignedBPGraphCycle

java.lang.Object
  extended by baobab.bio.permutation.BPGraphCycle
      extended by baobab.bio.permutation.SignedBPGraphCycle
All Implemented Interfaces:
java.lang.Comparable

public class SignedBPGraphCycle
extends BPGraphCycle

The SignedBPGraphCycle class represents a cycle of points of a the breakpoint graph of a signed permutation pair

Author:
Marilia D. V. Braga

Method Summary
static java.util.Vector<int[]> blocksToIntArrays(java.util.Collection blocks)
          Transforms the collection of blocks to a collection of arrays of int (with length = 2)
 int compareTo(java.lang.Object object)
          Compares this block to another block
 SignedBPGraphComponent getComponent()
          Gets the component to which this cycle belongs
 BPGraphPoint getFirstPoint()
          Gets the start point of this cycle in the permutation
 BPGraphPoint getLastPoint()
          Gets the end point of this cycle in the permutation
 BPGraphCyclePartition getPartition(int id)
          Gets a partition of this cycle, given its id
 PermutationBPGraph getPermutationBPGraph()
          Gets the permutation breakpoint graph to which this element belongs
 boolean isAdjacency()
          Tests whether this block is an adjacency
 boolean isOriented()
          Tests whether this block is oriented
 int length()
          Gets the length of the block (the number of values of the permutation between its start and end points)
 int[] toIntArray()
          Gets a representation of the block as an array of int, with size 2, representing its start and end positions
 java.lang.String toString()
           
 
Methods inherited from class baobab.bio.permutation.BPGraphCycle
getBreakpoints, getNumber, getPoints, getPointsAsCycle, isActive, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getComponent

public SignedBPGraphComponent getComponent()
Gets the component to which this cycle belongs

Returns:
the component

getFirstPoint

public BPGraphPoint getFirstPoint()
Gets the start point of this cycle in the permutation

Overrides:
getFirstPoint in class BPGraphCycle
Returns:
the start point

getLastPoint

public BPGraphPoint getLastPoint()
Gets the end point of this cycle in the permutation

Overrides:
getLastPoint in class BPGraphCycle
Returns:
the end point

isOriented

public boolean isOriented()
Tests whether this block is oriented

Returns:
true/false

getPartition

public BPGraphCyclePartition getPartition(int id)
Gets a partition of this cycle, given its id

Overrides:
getPartition in class BPGraphCycle
Parameters:
id - the partition id
Returns:
the corresponding cycle partition

toString

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

isAdjacency

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

Returns:
true/false

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

toIntArray

public int[] toIntArray()
Gets a representation of the block as an array of int, with size 2, representing its start 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
Parameters:
object - the other block
Returns:
the result of the comparison, as an int

blocksToIntArrays

public static java.util.Vector<int[]> blocksToIntArrays(java.util.Collection blocks)
Transforms the collection of blocks to a collection of arrays of int (with length = 2)

Parameters:
blocks - a collection of blocks
Returns:
a collection containing the blocks as arrays of int

getPermutationBPGraph

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

Returns:
the breakpoint graph to which this element belongs