groovy.util
Class OrderBy<T>

java.lang.Object
  extended by groovy.util.OrderBy<T>
All Implemented Interfaces:
Comparator<T>

public class OrderBy<T>
extends Object
implements Comparator<T>

A helper class for sorting objects via a closure to return the field or operation on which to sort.

Version:
$Revision: 16878 $
Author:
James Strachan

Constructor Summary
OrderBy()
           
OrderBy(Closure closure)
           
OrderBy(List<Closure> closures)
           
 
Method Summary
 void add(Closure closure)
           
 int compare(T object1, T object2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

OrderBy

public OrderBy()

OrderBy

public OrderBy(Closure closure)

OrderBy

public OrderBy(List<Closure> closures)
Method Detail

add

public void add(Closure closure)

compare

public int compare(T object1,
                   T object2)
Specified by:
compare in interface Comparator<T>

Copyright © 2003-2010 The Codehaus. All rights reserved.