001 package org.kuali.maven.ec2.pojo; 002 003 import java.util.Comparator; 004 005 public class RowComparator implements Comparator<Row> { 006 int elementIndex; 007 008 @Override 009 public int compare(Row row1, Row row2) { 010 String s1 = row1.getElements().get(elementIndex); 011 String s2 = row2.getElements().get(elementIndex); 012 return s1.compareTo(s2); 013 } 014 015 public int getElementIndex() { 016 return elementIndex; 017 } 018 019 public void setElementIndex(int elementIndex) { 020 this.elementIndex = elementIndex; 021 } 022 023 }