Java Code Examples for ims.framework.utils.Time.setSecond()

The following are Jave code examples for showing how to use setSecond() of the ims.framework.utils.Time class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
public int compare(StoolScaleVo o1, StoolScaleVo o2)
{
	if (o1 != null && o1.getDateTimeInitiatedIsNotNull() && o2!=null && o2.getDateTimeInitiatedIsNotNull())
	{
		Time time1 = o1.getDateTimeInitiated().getTime();
		Time time2 = o2.getDateTimeInitiated().getTime();
		
		time1.setSecond(0);
		time2.setSecond(0);
		
		DateTime dateToCompare1 = new DateTime(o1.getDateTimeInitiated().getDate(), time1);
		DateTime dateToCompare2 = new DateTime(o2.getDateTimeInitiated().getDate(), time2);
		
		int dateOrder = order*dateToCompare1.compareTo(dateToCompare2);
		
		if(dateOrder == 0)
		{
			return compareByHcp(o1, o2);
		}
		
		return dateOrder;
	}
	
	if (o1 == null || !o1.getDateTimeInitiatedIsNotNull())
		return -1*order;
	
	if (o2 == null || !o2.getDateTimeInitiatedIsNotNull())
		return order;
	
	return 0;
}