baobab.bio.permutation
Class BPGraphCycle

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

public class BPGraphCycle
extends java.lang.Object

The BPGraphCycle class represents a cycle of points of a permutation breakpoint graph

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
 java.util.SortedSet<BPGraphPoint> getBreakpoints()
          Gets the breakpoint list of this cycle
 BPGraphPoint getFirstPoint()
          Gets the first point of this cycle in the breakpoint graph
 BPGraphPoint getLastPoint()
          Gets the last point of this cycle in the breakpoint graph
 int getNumber()
          Gets the cycle number
 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
 java.util.SortedSet<BPGraphPoint> getPoints()
          Gets the points of this cycle sorted in ascendant order
 java.util.Iterator getPointsAsCycle()
          Gets the points of this cycle ordered as a cycle
 boolean isActive()
          Tests whether this cycle is active (analyzed)
 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)
 int size()
          Gets the number of points in this cycle
 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 java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getFirstPoint

public BPGraphPoint getFirstPoint()
Gets the first point of this cycle in the breakpoint graph

Returns:
the first point

getLastPoint

public BPGraphPoint getLastPoint()
Gets the last point of this cycle in the breakpoint graph

Returns:
the last point

getNumber

public int getNumber()
Gets the cycle number

Returns:
the cycle number

size

public int size()
Gets the number of points in this cycle

Returns:
the number of points

getBreakpoints

public java.util.SortedSet<BPGraphPoint> getBreakpoints()
Gets the breakpoint list of this cycle

Returns:
a Collection with the list of breakpoints (each breakpoint is represented by a Point)

isActive

public boolean isActive()
Tests whether this cycle is active (analyzed)

Returns:
true/false

getPointsAsCycle

public java.util.Iterator getPointsAsCycle()
Gets the points of this cycle ordered as a cycle

Returns:
a Collection with the ordered points

getPoints

public java.util.SortedSet<BPGraphPoint> getPoints()
Gets the points of this cycle sorted in ascendant order

Returns:
a Collection with the sorted points

getPartition

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

Parameters:
id - the partition id
Returns:
the corresponding cycle partition

toString

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

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