blob: bfeaa848396eef97b68da9dfdd3d8c819f245f44 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 University of Illinois at Urbana-Champaign and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* UIUC - Initial API and implementation
*******************************************************************************/
package org.eclipse.rephraserengine.core.vpg.eclipse;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
/**
* An {@link ISchedulingRule} for jobs which access a VPG.
* <p>
* Only one job with a {@link VPGSchedulingRule} is allowed to run at any single point in time.
* <p>
* This class is a Singleton; the singleton instance is accessed via the {@link #getInstance()}
* method.
* <p>
* <a href="../../../../overview-summary.html#Eclipse">More Information</a>
*
* @author Jeff Overbey
*
* @since 8.0
*/
public class VPGSchedulingRule implements ISchedulingRule
{
private static VPGSchedulingRule instance = null;
public static VPGSchedulingRule getInstance()
{
if (instance == null) instance = new VPGSchedulingRule();
return instance;
}
private VPGSchedulingRule() {}
public boolean isConflicting(ISchedulingRule rule)
{
return rule == this;
}
public boolean contains(ISchedulingRule rule)
{
return rule == this;
}
}