public class Permutation extends Object
Constructor and Description |
---|
Permutation(long id,
int[] perm)
Creates permutation object from a given array of integers.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(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() |
String |
toString()
Represents permutation in condensed format.
|
public Permutation(long id, int[] perm)
perm
- array of integerspublic long getID()
public int getLength()
public int get(int i) throws ArrayIndexOutOfBoundsException
i
- index of requested element, should be [0 .. length()-1]ArrayIndexOutOfBoundsException
public 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.
Copyright © 2016 Egothor. All Rights Reserved.