|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.util.OneDimSort
public class OneDimSort
This class implements a MultiDimSort
that
simply sorts the arrays according to one dimension specified in the
constructor. The sort uses method
sort
from class
Arrays
.
The dimension (dimState) of the states to be sorted
may be specified. For example, it is possible to sort a 2-dimensional
state by using only its first coordinate (OneDimSort(0, 2)),
or only its second coordinate (OneDimSort(1, 2) or
OneDimSort(1)).
Constructor Summary | |
---|---|
OneDimSort(int sortCoordinate)
Constructs a OneDimSort object that will sort states
with respect to their last coordinate sortCoordinate. |
|
OneDimSort(int sortCoordinate,
int dimState)
Constructs a OneDimSort object that will sort states with respect
to their sortCoordinate-th coordinate. |
Method Summary | ||
---|---|---|
int |
dimension()
Returns the dimension of the states to be sorted. |
|
int |
getSortCoordinate()
Returns the coordinate used for sorting. |
|
void |
sort(double[][] a)
Sorts the entire array. |
|
void |
sort(double[][] a,
int iMin,
int iMax)
Sorts the subarray of a made of the elements with indices from iMin to iMax-1. |
|
|
sort(T[] a)
Sorts the entire array. |
|
|
sort(T[] a,
int iMin,
int iMax)
Sorts the subarray of a made of the elements with indices from iMin to iMax-1. |
|
String |
toString()
Returns a String containing information about this object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OneDimSort(int sortCoordinate, int dimState)
OneDimSort
object that will sort states with respect
to their sortCoordinate-th coordinate.
The states have dimension dimState.
sortCoordinate is a value in
0 <=
public OneDimSort(int sortCoordinate)
OneDimSort
object that will sort states
with respect to their last coordinate sortCoordinate.
The dimension of the states is sortCoordinate + 1.
Method Detail |
---|
public <T extends MultiDimComparable<? super T>> void sort(T[] a, int iMin, int iMax)
MultiDimSort
sort
in interface MultiDimSort
a
- array to sortiMin
- index of first element to sortiMax
- index of last element to sort is
public <T extends MultiDimComparable<? super T>> void sort(T[] a)
MultiDimSort
sort
in interface MultiDimSort
a
- array to sortpublic void sort(double[][] a, int iMin, int iMax)
MultiDimSort
sort
in interface MultiDimSort
a
- array to sortiMin
- index of first element to sortiMax
- index of last element to sort is
public void sort(double[][] a)
MultiDimSort
sort
in interface MultiDimSort
a
- array to sortpublic int getSortCoordinate()
public int dimension()
dimension
in interface MultiDimSort
public String toString()
toString
in class Object
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |