001 /* 002 * @(#)ComparatorInterface 0.3.0 2001/04/21 003 * 004 * Copyright (c) 2001 Marco Schmidt <marcoschmidt@users.sourceforge.net> 005 * All rights reserved. 006 */ 007 008 package net.sourceforge.jiu.util; 009 010 /** 011 * To be able to do sorting in Java 1.1 as defined in java.util.Arrays (which 012 * is only available in Java 1.2 and higher), we offer a java.util.Comparator 013 * clone under a different name: ComparatorInterface. 014 * Sorting will be provided by the {@link Sort} class of this package. 015 */ 016 public interface ComparatorInterface 017 { 018 /** 019 * Compares the two argument objects and returns their relation. 020 * Returns 021 * <ul> 022 * <li>a value < 0 if <code>o1</code> is smaller than <code>o2</code>,</li> 023 * <li>0 if <code>o1</code> is equal to <code>o2</code> and</li> 024 * <li>a value > 0 if <code>o1</code> is greater than <code>o2</code>.</li> 025 * </ul> 026 */ 027 int compare(Object o1, Object o2); 028 }