|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbaobab.bio.permutation.UnsignedPermutation
public class UnsignedPermutation
The UnsignedPermutation class represents an unsigned permutation
Constructor Summary | |
---|---|
UnsignedPermutation(int[] permutationList)
Creates a new linear permutation (assumes the identity permutation as target) |
|
UnsignedPermutation(int[] permutationList,
boolean isLinear)
Creates a new permutation (assumes the identity permutation as target) |
|
UnsignedPermutation(int[] originList,
int[] targetList)
Creates a new linear permutation |
|
UnsignedPermutation(int[] originList,
int[] targetList,
boolean isLinear)
Creates a new permutation |
|
UnsignedPermutation(java.util.Vector<java.lang.String> origin,
java.util.Vector<java.lang.String> target,
boolean isLinear)
Creates a new permutation |
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) |
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object object)
Compares this block to another block |
boolean |
equals(UnsignedPermutation perm)
|
java.util.SortedSet<Point> |
getBreakpoints()
Gets the breakpoint list of this block |
java.util.SortedSet<Cycle> |
getCycles()
Gets the list of cycles of this group of cycles |
java.lang.String |
getData()
|
Point |
getEndPoint()
Gets the end point of the permutation |
PermutationFormatter |
getFormatter()
|
int |
getLongestNameLength()
|
int |
getMappedValueOf(int pos)
Gets the value of the mapped element located at a specified position of the permutation |
java.lang.String |
getNameOf(int pos)
Gets the value of the element located at a specified position of the permutation |
int |
getNumberOfCycles()
Gets the number of cycles of this group of cycles |
Permutation |
getPermutation()
Gets this permutation |
Point |
getPointAt(int pos)
Gets a point at a specific position of the permutation |
java.util.SortedSet<Point> |
getPoints()
Gets all points which belong to this group of cycles |
int |
getPositionOf(int value)
Gets the position where a specified element of the permutation is located |
int |
getPositionOfMapped(int value)
Gets the position where a specified mapped element of the permutation is located |
Point |
getStartPoint()
Gets the start point of the permutation |
java.util.SortedSet<Cycle> |
getUnorientedCycles()
Gets the list of non-oriented cycles of this group of cycles |
int |
getValueOf(int pos)
Gets the value of the element located at a specified position of the permutation |
boolean |
isAdjacency()
Tests whether this permutation is sorted |
boolean |
isLinear()
Tests whether the permutation is linear or circular |
boolean |
isRevertedAt(int pos)
Gets the value of the element located at a specified position of the permutation |
boolean |
isSorted()
Tests whether this permutation is sorted |
int |
length()
Gets the length of the block (the number of values of the permutation between its start and end points) |
UnsignedPermutation |
revert(int start,
int end)
Reverts the permutation between the specified positions |
UnsignedPermutation |
revert(Point start,
Point end)
Reverts the permutation between the specified points |
UnsignedPermutation |
revert(ReversalBlock block)
Reverts the specified block of the permutation |
UnsignedPermutation |
revertToNewPermutation(Point start,
Point end)
Make a new permutation, by reverting the permutation between the specified positions |
int |
size()
Gets the size (or the number of elements) of the permutation |
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()
|
UnsignedPermutation |
transposeToNewPermutation(int start,
int middle,
int end)
Make a new permutation, by transposing the permutation between the specified positions |
UnsignedPermutation |
transposeToNewPermutation(Point start,
Point middle,
Point end)
Make a new permutation, by transposing the permutation between the specified positions |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface baobab.bio.permutation.Permutation |
---|
getNumberOfCycles |
Constructor Detail |
---|
public UnsignedPermutation(int[] permutationList)
permutationList
- the list of signed integers (from +/-1 to +/-n), as an array of intpublic UnsignedPermutation(int[] permutationList, boolean isLinear)
permutationList
- the list of signed integers (from +/-1 to +/-n), as an array of intisLinear
- indicates whether the permutation is linear or circularpublic UnsignedPermutation(int[] originList, int[] targetList)
originList
- the origin list of signed integers (from +/-1 to +/-n), as an array of inttargetList
- the target list of signed integers (from +/-1 to +/-n), as an array of intpublic UnsignedPermutation(int[] originList, int[] targetList, boolean isLinear)
originList
- the origin list of signed integers (from +/-1 to +/-n), as an array of inttargetList
- the target list of signed integers (from +/-1 to +/-n), as an array of intisLinear
- indicates whether the permutation is linear or circularpublic UnsignedPermutation(java.util.Vector<java.lang.String> origin, java.util.Vector<java.lang.String> target, boolean isLinear)
originList
- the origin list of signed markerstargetList
- the target list of signed markersisLinear
- indicates whether the permutation is linear or circularMethod Detail |
---|
public boolean isLinear()
isLinear
in interface Permutation
public Point getStartPoint()
public Point getEndPoint()
public Permutation getPermutation()
public int size()
size
in interface Permutation
public Point getPointAt(int pos)
getPointAt
in interface Permutation
pos
- the given position
public int getMappedValueOf(int pos)
getMappedValueOf
in interface Permutation
pos
- the specified position
public int getValueOf(int pos)
getValueOf
in interface Permutation
pos
- the specified position
public int getLongestNameLength()
getLongestNameLength
in interface Permutation
public java.lang.String getNameOf(int pos)
getNameOf
in interface Permutation
pos
- the specified position
public boolean isRevertedAt(int pos)
isRevertedAt
in interface Permutation
pos
- the specified position
public int getPositionOf(int value)
getPositionOf
in interface Permutation
value
- the value of the specified element
public int getPositionOfMapped(int value)
getPositionOfMapped
in interface Permutation
value
- the value of the specified mapped element
public UnsignedPermutation revert(ReversalBlock block) throws PermutationException
block
- the block to be reverted
PermutationException
public UnsignedPermutation revert(Point start, Point end) throws PermutationException
start
- the beginning of the reversion blockend
- the end of the reversion block
PermutationException
public UnsignedPermutation revert(int start, int end)
start
- the beginning of the reversion blockend
- the end of the reversion block
public UnsignedPermutation revertToNewPermutation(Point start, Point end) throws PermutationException
start
- the beginning of the reversion blockend
- the end of the reversion block
PermutationException
public UnsignedPermutation transposeToNewPermutation(Point start, Point middle, Point end) throws PermutationException
start
- the beginning of the transposition blockmiddle
- the middle of the transposition blockend
- the end of the transposition block
PermutationException
public UnsignedPermutation transposeToNewPermutation(int start, int middle, int end)
start
- the beginning of the transposition blockmiddle
- the middle of the transposition blockend
- the end of the transposition block
public boolean isAdjacency()
public boolean isSorted()
isSorted
in interface Permutation
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(UnsignedPermutation perm)
public PermutationFormatter getFormatter()
getFormatter
in interface Permutation
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getData()
public java.util.SortedSet<Point> getBreakpoints()
public java.util.SortedSet<Point> getPoints()
public int getNumberOfCycles()
public java.util.SortedSet<Cycle> getCycles()
public java.util.SortedSet<Cycle> getUnorientedCycles()
public int length()
public int[] toIntArray()
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
object
- the other block
public static java.util.Vector<int[]> blocksToIntArrays(java.util.Collection blocks)
blocks
- a collection of blocks
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |