View Javadoc

1   package org.kuali.maven.ec2.pojo;
2   
3   import java.util.Comparator;
4   
5   public class RowComparator implements Comparator<Row> {
6       int elementIndex;
7   
8       @Override
9       public int compare(Row row1, Row row2) {
10          String s1 = row1.getElements().get(elementIndex);
11          String s2 = row2.getElements().get(elementIndex);
12          return s1.compareTo(s2);
13      }
14  
15      public int getElementIndex() {
16          return elementIndex;
17      }
18  
19      public void setElementIndex(int elementIndex) {
20          this.elementIndex = elementIndex;
21      }
22  
23  }