listFW.visitor
Class Reverse<T>

java.lang.Object
  extended by listFW.visitor.Reverse<T>
All Implemented Interfaces:
IListAlgo<T,IList<T>,IListFactory<T>>

public class Reverse<T>
extends java.lang.Object
implements IListAlgo<T,IList<T>,IListFactory<T>>

Reverses a list. The first of the varargs (input[0]) needs to be an IListFactory.


Constructor Summary
Reverse()
           
 
Method Summary
 IList<T> emptyCase(IMTList<? extends T> host, IListFactory<T>... fac)
          Returns the empty list.
 IList<T> nonEmptyCase(INEList<? extends T> host, IListFactory<T>... fac)
          Returns the reversed list.
 
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

emptyCase

public IList<T> emptyCase(IMTList<? extends T> host,
                          IListFactory<T>... fac)
Returns the empty list.

Specified by:
emptyCase in interface IListAlgo<T,IList<T>,IListFactory<T>>
Parameters:
fac - fac[0] is a list factory

nonEmptyCase

public IList<T> nonEmptyCase(INEList<? extends T> host,
                             IListFactory<T>... fac)
Returns the reversed list.

Specified by:
nonEmptyCase in interface IListAlgo<T,IList<T>,IListFactory<T>>
Parameters:
fac - fac[0] is a list factory