|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.egothor.duplicity.util.Permutation
public class Permutation
Represents a permutation of integers.
Constructor Summary | |
---|---|
Permutation(long id,
int[] perm)
Creates permutation object from a given array of integers. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
int |
get(int i)
Get the i-th permutation element. |
long |
getID()
|
int |
getLength()
Returns the number of elements the permutation consists of. |
int |
hashCode()
|
java.lang.String |
toString()
Represents permutation in condensed format. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Permutation(long id, int[] perm)
perm
- array of integersMethod Detail |
---|
public long getID()
public int getLength()
public int get(int i) throws java.lang.ArrayIndexOutOfBoundsException
i
- index of requested element, should be [0 .. length()-1]
java.lang.ArrayIndexOutOfBoundsException
public java.lang.String toString()
0 1 2 3 4 5 6 7 8 9 10 4 10 8 2 3 0 1 5 7 6 9would be expressed in following format:
0 -> 4,10,8,2,3, 5 -> 0,1,5,7,6, 10 -> 9,The number of elements on a row is determined by the TOSTRING_ELEMENT_PER_ROW constant.
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |