java4all@1986 java. Powered by Blogger.

Reverse Order Comparator

>> Tuesday, May 24, 2011

import java.util.Comparator;
public class ReverseOrder<T> implements Comparator<T>
{
    private Comparator<T> m_comparator;
    
    public ReverseOrder(Comparator<T> comp)
    {
        m_comparator = comp;
    }

public int compare(T arg0, T arg1)
    {
        return -* m_comparator.compare(arg0, arg1);
    }
}

0 comments:

Post a Comment

FaceBook Login

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

Total Pageviews

STATCOUNTER

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP