|
NameComparator |
|
1 /* 2 * Copyright (c) 1998-2001, The University of Sheffield. 3 * 4 * This file is part of GATE (see http://gate.ac.uk/), and is free 5 * software, licenced under the GNU Library General Public License, 6 * Version 2, June 1991 (in the distribution as file licence.html, 7 * and also available at http://gate.ac.uk/gate/licence.html). 8 * 9 * Valentin Tablan 02/10/2001 10 * 11 * $Id: NameComparator.java,v 1.1 2001/10/03 10:09:12 valyt Exp $ 12 * 13 */ 14 package gate.util; 15 16 import gate.*; 17 import java.util.Comparator; 18 19 /** 20 * Compares {@link NameBearer}s by name (string comparation) 21 */ 22 public class NameComparator implements Comparator { 23 24 public int compare(Object o1, Object o2){ 25 NameBearer nb1 = (NameBearer)o1; 26 NameBearer nb2 = (NameBearer)o2; 27 return nb1.getName().compareTo(nb2.getName()); 28 } 29 }
|
NameComparator |
|