net.sf.jga.algorithms
Class Reverse

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

public class Reverse
extends java.lang.Object

Reverses the order of the input

Copyright © 2007 David A. Hall


Nested Class Summary
static class Reverse.ReverseArrayIterable<T>
           
static class Reverse.ReverseIterable<T>
           
static class Reverse.ReverseIterator<T>
           
 
Constructor Summary
Reverse()
           
 
Method Summary
static
<T,TCollection extends java.util.Collection<? super T>>
TCollection
reverse(java.lang.Iterable<? extends T> i, TCollection co)
          Appends the reversed contents of the input to the output.
static
<T> java.lang.Iterable<T>
reverse(java.lang.Iterable<T> i)
          Returns an iterable object over the reversed contents of the input.
static
<T> java.util.Iterator<T>
reverse(java.util.Iterator<T> i)
          Returns an iterator object over the reversed contents of the input.
static
<T> java.lang.Iterable<T>
reverse(T[] ts)
          Returns an iterable object over the reversed contents of the array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reverse

public Reverse()
Method Detail

reverse

public static <T> java.lang.Iterable<T> reverse(T[] ts)
Returns an iterable object over the reversed contents of the array. The array will not be modified.


reverse

public static <T> java.lang.Iterable<T> reverse(java.lang.Iterable<T> i)
Returns an iterable object over the reversed contents of the input. The input itself will not be modified.


reverse

public static <T> java.util.Iterator<T> reverse(java.util.Iterator<T> i)
Returns an iterator object over the reversed contents of the input. The input itself will not be modified.


reverse

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



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