package org.apache.commons.collections.comparators;

import java.io.Serializable;
import java.util.Comparator;

public class ReverseComparator implements Comparator, Serializable {
  private Comparator comparator;
  
  public ReverseComparator() {
    this(null);
  }
  
  public ReverseComparator(Comparator paramComparator) {
    if (paramComparator != null) {
      this.comparator = paramComparator;
    } else {
      this.comparator = ComparableComparator.getInstance();
    } 
  }
  
  public int compare(Object paramObject1, Object paramObject2) {
    return this.comparator.compare(paramObject2, paramObject1);
  }
}
