01: /*
02: * Copyright (c) 2006 Your Corporation. All Rights Reserved.
03: */
04: package com.technoetic.xplanner.domain;
05:
06: import java.util.Comparator;
07:
08: /**
09: * Created by IntelliJ IDEA.
10: * User: sg310782
11: * Date: Mar 13, 2006
12: * Time: 2:51:25 PM
13: * To change this template use File | Settings | File Templates.
14: */
15: public class StoryOrderNoChangeComparator implements Comparator {
16:
17: public int compare(Object o1, Object o2) {
18: UserStory userStory1 = (UserStory) o1;
19: UserStory userStory2 = (UserStory) o2;
20: int compare = new Integer(userStory1.getOrderNo())
21: .compareTo(new Integer(userStory2.getOrderNo()));
22: if (compare == 0) {
23: compare = -(new Integer(userStory1.getPreviousOrderNo())
24: .compareTo(new Integer(userStory2
25: .getPreviousOrderNo())));
26: }
27: return compare;
28: }
29: }
|