|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object auditor.Permutation
public class Permutation
This class implements operations on permutations
Field Summary | |
---|---|
(package private) int |
length
|
(package private) int[] |
perm
|
Constructor Summary | |
---|---|
Permutation(int n)
Default constructor - creates array of integers of given size |
|
Permutation(Permutation p)
|
|
Permutation(java.lang.String permutation)
For proper string of integers (separated with single spaces) transforms it into array of integers |
|
Permutation(java.lang.String pString,
int start,
int pLength)
Creates a permutation of a length equal to pLength from a given pString, starting from the start integer |
Method Summary | |
---|---|
boolean |
Compare(Permutation b)
Method that compares two permutation arrays. |
int |
getElement(int i)
Method returns i'th element of a permutation |
int |
getLength()
|
Permutation |
inversePerm()
Method returns inverse permutation to the given one. |
Permutation |
multiplyRight(Permutation b)
Method returns permutation which is a multiplication of a permutation a and a permutation b. |
void |
setElement(int i,
int val)
Method sets val into i'th element of the permutation |
java.lang.String |
showPerm()
Method that creates a string with permutation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
int[] perm
int length
Constructor Detail |
---|
public Permutation(int n)
n
- public Permutation(java.lang.String permutation)
permutation
- public Permutation(java.lang.String pString, int start, int pLength)
pString
- start
- pLength
- public Permutation(Permutation p)
Method Detail |
---|
public int getLength()
public java.lang.String showPerm()
public int getElement(int i)
i
- - element index
public void setElement(int i, int val)
i
- val
- public Permutation multiplyRight(Permutation b) throws java.lang.Exception
b
- Input permutation
java.lang.Exception
- If the input permutations have different lengthpublic Permutation inversePerm()
public boolean Compare(Permutation b)
b
- Second permutation to compare
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |