SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | List of all members
OneDimSort< T extends MultiDimComparable<? super T > Class Template Reference

This class implements a MultiDimSortComparable that simply sorts the objects according to a given sorting coordinate \(j \ge0\) specified in the constructor. More...

Inheritance diagram for OneDimSort< T extends MultiDimComparable<? super T >:
[legend]
Collaboration diagram for OneDimSort< T extends MultiDimComparable<? super T >:
[legend]

Public Member Functions

 OneDimSort (int j, int d)
 Constructs a OneDimSort object that will sort the MultiDimComparable<T> objects according to coordinate \(j\). More...
 
 OneDimSort (int j)
 Constructs a OneDimSort that will sort the objects with respect to their coordinate \(j\). More...
 
void sort (T[] a, int iMin, int iMax)
 
void sort (T[] a)
 
void sort (double[][] a, int iMin, int iMax)
 
void sort (double[][] a)
 
int getSortCoordinate ()
 Returns the coordinate \(j\) used for sorting. More...
 
int dimension ()
 Returns the dimension \(d\) of the states to be sorted. More...
 
String toString ()
 Returns a String containing information about this object. More...
 

Detailed Description

This class implements a MultiDimSortComparable that simply sorts the objects according to a given sorting coordinate \(j \ge0\) specified in the constructor.

One must have \(j \in\{0,…,d-1\}\) where \(d\) is the dimension of the MultiDimComparable<T> objects to be sorted. The sort uses the method java.util.Arrays.sort from class Arrays. For example, to sort objects based on the first coordinate, one should use OneDimSort(0). It is also possible to specify in the constructor the dimension \(d\) (dimState) of the objects to be sorted.

Remarks
Pierre: Is this useful for something? Give an example. Perhaps when sorting a CachedPointSet?

Constructor & Destructor Documentation

◆ OneDimSort() [1/2]

OneDimSort ( int  j,
int  d 
)

Constructs a OneDimSort object that will sort the MultiDimComparable<T> objects according to coordinate \(j\).

The sorted objects are assumed to have dimension d.

◆ OneDimSort() [2/2]

OneDimSort ( int  j)

Constructs a OneDimSort that will sort the objects with respect to their coordinate \(j\).

The dimension returned by dimension() will then be \(d=j+1\).

Member Function Documentation

◆ dimension()

int dimension ( )

Returns the dimension \(d\) of the states to be sorted.

Returns
dimension d of states

◆ getSortCoordinate()

int getSortCoordinate ( )

Returns the coordinate \(j\) used for sorting.

Returns
coordinate j used for sorting

◆ toString()

String toString ( )

Returns a String containing information about this object.

Returns
a String

The documentation for this class was generated from the following file: