baobab.bio.permutation
Class SignedCycle

java.lang.Object
  extended by baobab.bio.permutation.Cycle
      extended by baobab.bio.permutation.SignedCycle
All Implemented Interfaces:
java.lang.Comparable

public class SignedCycle
extends Cycle

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

Version:
1.0, May 2006
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
 SignedComponent getComponent()
          Gets the component to which this cycle belongs
 Point getEndPoint()
          Gets the end point of this cycle in the permutation
 CyclePartition getPartition(int id)
          Gets a partition of this cycle, given its id
 Permutation getPermutation()
          Gets the permutation to which this element belongs
 Point getStartPoint()
          Gets the start point of this cycle in the permutation
 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.Cycle
getBreakpoints, getNumber, getPoints, getPointsAsCycle, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getComponent

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

Returns:
the component

getStartPoint

public Point getStartPoint()
Gets the start point of this cycle in the permutation

Overrides:
getStartPoint in class Cycle
Returns:
the start point

getEndPoint

public Point getEndPoint()
Gets the end point of this cycle in the permutation

Overrides:
getEndPoint in class Cycle
Returns:
the end point

isOriented

public boolean isOriented()
Tests whether this block is oriented

Returns:
true/false

getPartition

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

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

toString

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

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

getPermutation

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

Returns:
the permutation to which this element belongs