Package org.ocpsoft.prettytime.units

Examples of org.ocpsoft.prettytime.units.TimeUnitComparator


    */
   public List<TimeUnit> getUnits()
   {
     if (mCachedUnits == null) {
       List<TimeUnit> result = new ArrayList<TimeUnit>(units.keySet());
       Collections.sort(result, new TimeUnitComparator());
       mCachedUnits = Collections.unmodifiableList(result);
     }

     return mCachedUnits;
     }
View Full Code Here


public class TimeUnitComparatorTest {

   @Test
   public void testComparingOrder() throws Exception
   {
      TimeUnitComparator comparator = new TimeUnitComparator();
      assertEquals(-1, comparator.compare(new Hour(), new Day()));
   }
View Full Code Here

TOP

Related Classes of org.ocpsoft.prettytime.units.TimeUnitComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.