FileDocCategorySizeDatePackage
PriorityTask.javaAPI DocExample817Mon Nov 13 12:11:54 GMT 2006collections

PriorityTask

public final class PriorityTask extends Object implements Comparable

Fields Summary
private final Task
task
private final Priority
priority
Constructors Summary
PriorityTask(Task task, Priority priority)

    this.task = task;
    this.priority = priority;
  
Methods Summary
public intcompareTo(collections.PriorityTask pt)

    int c = priority.compareTo(pt.priority);
    return c != 0 ? c : task.compareTo(pt.task);
  
public booleanequals(java.lang.Object o)

    if (o instanceof PriorityTask) {
      PriorityTask pt = (PriorityTask)o;
      return task.equals(pt.task) && priority.equals(pt.priority);
    } else return false;
  
public PrioritygetPriority()

 return priority; 
public TaskgetTask()

 return task; 
public inthashCode()

 return task.hashCode(); 
public java.lang.StringtoString()

 return task + ": " + priority;