View Javadoc

1   package uk.ac.ebi.intenz.domain.enzyme;
2   
3   import java.util.Comparator;
4   
5   import uk.ac.ebi.xchars.SpecialCharacters;
6   import uk.ac.ebi.xchars.domain.EncodingType;
7   
8   /**
9    * Compares enzyme entries according to their common name
10   * (SwissProt - ASCII - encoding).
11   * @author rafalcan
12   */
13  public class EnzymeEntryNameComparator implements Comparator<EnzymeEntry> {
14  
15  	public int compare(EnzymeEntry o1, EnzymeEntry o2) {
16  		String name1 = SpecialCharacters.getInstance(null).xml2Display(
17  				o1.getCommonName().getName(), EncodingType.SWISSPROT_CODE);
18  		String name2 = SpecialCharacters.getInstance(null).xml2Display(
19  				o2.getCommonName().getName(), EncodingType.SWISSPROT_CODE);
20  		return name1.compareTo(name2);
21  	}
22  
23  }