1 15 package org.apache.tapestry.contrib.table.model.simple; 16 17 import java.util.Comparator ; 18 19 42 public class ColumnComparator implements Comparator 43 { 44 private SimpleTableColumn m_objColumn; 45 private Comparator m_objComparator; 46 47 public ColumnComparator(SimpleTableColumn objColumn, Comparator objComparator) 48 { 49 m_objColumn = objColumn; 50 m_objComparator = objComparator; 51 } 52 53 56 public int compare(Object objRow1, Object objRow2) 57 { 58 Object objValue1 = m_objColumn.getColumnValue(objRow1); 59 Object objValue2 = m_objColumn.getColumnValue(objRow2); 60 61 return m_objComparator.compare(objValue1, objValue2); 62 } 63 64 } 65 | Popular Tags |