コード例 #1
0
 /**
  * Adds an entry at the end of the list of which this item is the head. @GuardedBy("manager.lock")
  */
 final void addLast(InternalJob entry) {
   InternalJob last = this;
   // find the end of the queue
   while (last.previous != null) last = last.previous;
   // add the new entry to the end of the queue
   last.previous = entry;
   entry.next = last;
   entry.previous = null;
 }
コード例 #2
0
 /** Returns true if this job conflicts with the given job, and false otherwise. */
 final boolean isConflicting(InternalJob otherJob) {
   ISchedulingRule otherRule = otherJob.getRule();
   if (schedulingRule == null || otherRule == null) return false;
   // if one of the rules is a compound rule, it must be asked the question.
   if (schedulingRule.getClass() == MultiRule.class)
     return schedulingRule.isConflicting(otherRule);
   return otherRule.isConflicting(schedulingRule);
 }
コード例 #3
0
 /** Removes this entry from any list it belongs to. Returns the receiver. */
 final InternalJob remove() {
   if (next != null) next.setPrevious(previous);
   if (previous != null) previous.setNext(next);
   next = previous = null;
   return this;
 }