|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthelix.graph.util.IPermutation
public class IPermutation
a class implementing an index permutation in range [from, to] TODO ISelector instead
Constructor Summary | |
---|---|
IPermutation(int range)
identity in [0, range-1] |
|
IPermutation(int from,
int to)
identity in [from, to] |
|
IPermutation(Iterable<Integer> values)
new IPermutation from values. |
|
IPermutation(String s)
new IPermutation from parsed String. |
Method Summary | ||
---|---|---|
|
apply(List<T> l)
apply permutation on list of objects. |
|
boolean |
containsAll(Iterable<Integer> set)
check if permutation contains the set of integers given as argument |
|
boolean |
equals(Object o)
override equals |
|
int |
from()
get permutation starting value (from) |
|
int |
get(int indx)
return value at given index |
|
int |
hashCode()
override hashCode |
|
IPermutation |
inverse()
returns a new IPermutation, inverse of this permutation |
|
boolean |
isIdentity()
check if permutation is identity in [0-n] |
|
Iterator<Integer> |
iterator()
|
|
int |
lookup(int value)
get index of value return -1 if value is not found |
|
IPermutation |
shift()
same as permutation.shift(-permutation.from()) i.e. |
|
IPermutation |
shift(int offset)
returns a new permutation with values shifted the specified offset. |
|
int |
size()
size of permutation |
|
int |
to()
get permutation ending value (to) |
|
String |
toString()
override |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IPermutation(Iterable<Integer> values)
public IPermutation(String s) throws NumberFormatException
NumberFormatException
public IPermutation(int from, int to)
public IPermutation(int range)
Method Detail |
---|
public Iterator<Integer> iterator()
iterator
in interface Iterable<Integer>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int get(int indx)
public int lookup(int value)
public int size()
public boolean isIdentity()
public boolean containsAll(Iterable<Integer> set)
public int from()
public int to()
public IPermutation shift(int offset)
public IPermutation shift()
permutation.shift(-permutation.from())
i.e.
return a new IPermutation starting at 0.
this function is usually used with apply when the initial
IPermutation is not in the proper range [0, size-1].
permutation.shift().apply(List)
public IPermutation inverse()
public <T> List<T> apply(List<T> l)
IllegalArgumentException
- if l.size() < permutation.to()public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |