org.eclipse.xtext.ui.editor
Class SchedulingRuleFactory.Sequence

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.SchedulingRuleFactory.Sequence
All Implemented Interfaces:
org.eclipse.core.runtime.jobs.ISchedulingRule
Enclosing class:
SchedulingRuleFactory

public static class SchedulingRuleFactory.Sequence
extends java.lang.Object
implements org.eclipse.core.runtime.jobs.ISchedulingRule

All jobs that are configured with the same instance of this rule will run sequentially.

Author:
Sebastian Zarnekow - Initial contribution and API

Constructor Summary
SchedulingRuleFactory.Sequence()
           
 
Method Summary
 boolean contains(org.eclipse.core.runtime.jobs.ISchedulingRule rule)
          Returns whether this scheduling rule completely contains another scheduling rule.
 boolean isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule rule)
          Returns whether this scheduling rule is compatible with another scheduling rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchedulingRuleFactory.Sequence

public SchedulingRuleFactory.Sequence()
Method Detail

contains

public boolean contains(org.eclipse.core.runtime.jobs.ISchedulingRule rule)
Description copied from interface: org.eclipse.core.runtime.jobs.ISchedulingRule
Returns whether this scheduling rule completely contains another scheduling rule. Rules can only be nested within a thread if the inner rule is completely contained within the outer rule.

Implementations of this method must obey the rules of a partial order relation on the set of all scheduling rules. In particular, implementations must be reflexive (a.contains(a) is always true), antisymmetric (a.contains(b) and b.contains(a) iff a.equals(b), and transitive (if a.contains(b) and b.contains(c), then a.contains(c)). Implementations of this method must return false when compared to a rule they know nothing about.

Specified by:
contains in interface org.eclipse.core.runtime.jobs.ISchedulingRule
Parameters:
rule - the rule to check for containment
Returns:
true if this rule contains the given rule, and false otherwise.

isConflicting

public boolean isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule rule)
Description copied from interface: org.eclipse.core.runtime.jobs.ISchedulingRule
Returns whether this scheduling rule is compatible with another scheduling rule. If true is returned, then no job with this rule will be run at the same time as a job with the conflicting rule. If false is returned, then the job manager is free to run jobs with these rules at the same time.

Implementations of this method must be reflexive, symmetric, and consistent, and must return false when compared to a rule they know nothing about.

This method must return true if calling ISchedulingRule.contains(ISchedulingRule) on the same rule also returns true. This is required because it would otherwise allow two threads to be running concurrently with the same rule.

Specified by:
isConflicting in interface org.eclipse.core.runtime.jobs.ISchedulingRule
Parameters:
rule - the rule to check for conflicts
Returns:
true if the rule is conflicting, and false otherwise.