net.sf.jga.algorithms
Class Sort

java.lang.Object
  extended by net.sf.jga.algorithms.Sort

public class Sort
extends java.lang.Object

Adapts standard java Sort capabilities to the interfaces common to jga.

Copyright © 2006 David A. Hall


Constructor Summary
Sort()
           
 
Method Summary
static
<T extends java.lang.Comparable<? super T>,TCollection extends java.util.Collection<? super T>>
TCollection
sort(java.lang.Iterable<? extends T> i, TCollection co)
          Appends the sorted contents of the input to the output.
static
<T extends java.lang.Comparable<? super T>>
java.lang.Iterable<T>
sort(java.lang.Iterable<T> i)
          Returns an iterable object over the sorted contents of the input.
static
<T> java.lang.Iterable<T>
sort(java.lang.Iterable<T> i, java.util.Comparator<? super T> comp)
          Returns an iterable object over the sorted contents of the input, using the given comparator to determine ordering.
static
<T,TCollection extends java.util.Collection<? super T>>
TCollection
sort(java.lang.Iterable<T> i, java.util.Comparator<? super T> comp, TCollection co)
          Appends the sorted contents of the input to the output, using the given comparator to determine ordering.
static
<T extends java.lang.Comparable<? super T>>
java.util.Iterator<T>
sort(java.util.Iterator<T> i)
          Returns an iterator object over the sorted contents of the input.
static
<T> java.util.Iterator<T>
sort(java.util.Iterator<T> i, java.util.Comparator<? super T> comp)
          Returns an iterator object over the sorted contents of the input, using the given comparator to determine ordering.
static
<T extends java.lang.Comparable<? super T>>
java.lang.Iterable<T>
sort(T[] ts)
          Returns an iterable object over the sorted contents of the array.
static
<T> java.lang.Iterable<T>
sort(T[] ts, java.util.Comparator<? super T> comp)
          Returns an iterable object over the sorted contents of the array, using the given comparator to determine ordering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sort

public Sort()
Method Detail

sort

public static <T extends java.lang.Comparable<? super T>> java.lang.Iterable<T> sort(T[] ts)
Returns an iterable object over the sorted contents of the array. The array will not be modified.


sort

public static <T> java.lang.Iterable<T> sort(T[] ts,
                                             java.util.Comparator<? super T> comp)
Returns an iterable object over the sorted contents of the array, using the given comparator to determine ordering. The array itself will not be modified. .


sort

public static <T extends java.lang.Comparable<? super T>> java.lang.Iterable<T> sort(java.lang.Iterable<T> i)
Returns an iterable object over the sorted contents of the input. The input itself will not be modified.


sort

public static <T> java.lang.Iterable<T> sort(java.lang.Iterable<T> i,
                                             java.util.Comparator<? super T> comp)
Returns an iterable object over the sorted contents of the input, using the given comparator to determine ordering. The input will not be modified.


sort

public static <T extends java.lang.Comparable<? super T>> java.util.Iterator<T> sort(java.util.Iterator<T> i)
Returns an iterator object over the sorted contents of the input. The input itself will not be modified.


sort

public static <T> java.util.Iterator<T> sort(java.util.Iterator<T> i,
                                             java.util.Comparator<? super T> comp)
Returns an iterator object over the sorted contents of the input, using the given comparator to determine ordering. The input will not be modified.


sort

public static <T extends java.lang.Comparable<? super T>,TCollection extends java.util.Collection<? super T>> TCollection sort(java.lang.Iterable<? extends T> i,
                                                                                                                               TCollection co)
Appends the sorted contents of the input to the output. The input will not be modified.


sort

public static <T,TCollection extends java.util.Collection<? super T>> TCollection sort(java.lang.Iterable<T> i,
                                                                                       java.util.Comparator<? super T> comp,
                                                                                       TCollection co)
Appends the sorted contents of the input to the output, using the given comparator to determine ordering. The input will not be modified.



Copyright © 2002-2006 David A. Hall. All Rights Reserved.