TaskDocumentOrderComparator.java :  » Project-Management » ganttproject » net » sourceforge » ganttproject » task » Java Open Source

Java Open Source » Project Management » ganttproject 
ganttproject » net » sourceforge » ganttproject » task » TaskDocumentOrderComparator.java
package net.sourceforge.ganttproject.task;

import java.util.Comparator;

class TaskDocumentOrderComparator implements Comparator {
  private final TaskManagerImpl myManager;
  TaskDocumentOrderComparator(TaskManagerImpl taskManager) {
    myManager = taskManager;
  }
  public int compare(Object object1, Object object2) {
    assert (object1 instanceof Task && object2 instanceof Task): "I compare only tasks";
    return myManager.getTaskHierarchy().compareDocumentOrder((Task)object1, (Task)object2);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.