org.eclipse.actf.validation.core
Class AbstractValidationProcess

java.lang.Object
  extended by java.util.Observable
      extended by org.eclipse.actf.validation.core.AbstractValidationProcess
All Implemented Interfaces:
IValidationProcess
Direct Known Subclasses:
AccessibilityValidationProcess, FocusValidationProcess

public abstract class AbstractValidationProcess
extends Observable
implements IValidationProcess

base implementation of IValidationProcess.

Note: Clients are encouraged to subclass this class rather than to implement IValidationProcess to maintane API compatibility.

Author:
John Buslawski

Field Summary
protected  IValidationContext context
           
protected  Map contextCache
           
protected  ExecutionPoint execPoint
           
protected  int lastNotification
           
protected  int notificationIncrement
           
protected  int notificationPercent
           
protected  int progress
           
protected  IRuleBase ruleBase
           
protected  int workEstimate
           
 
Constructor Summary
AbstractValidationProcess()
           
 
Method Summary
 ExecutionPoint getExecutionPoint()
          returns the ExecutionPoint triggering this IValidationProcess.
 int getNotificationPercent()
           
 int getProgress()
          returns the approximate progress relative to the amount of estimated work as an integer percentage.
 IRuleBase getRuleBase()
          returns the IRuleBase used in this IValidationProcess.
 IValidationContext getValidationContext()
          returns the IValidationContext used in this IValidationProcess.
 int getWorkEstimate()
          returns an estimate on the amount of work required by this process.
protected  void incrementProgress()
          increments the progress value by one.
protected  void initProgressEstimates()
           
protected  boolean isTerminated()
           
protected  void resetProgress()
           
 void setExecutionPoint(ExecutionPoint executionPoint)
          sets the ExecutionPoint used in this IValidationProcess.
 void setNotificationPercent(int percent)
           
protected  void setProgress(int newProgress)
           
 void setRuleBase(IRuleBase iRuleBase)
          sets the IRuleBase used in this IValidationProcess.
 void setValidationContext(IValidationContext valContext)
          sets the IValidationContext used in this IValidationProcess.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.actf.validation.core.IValidationProcess
init, run
 

Field Detail

ruleBase

protected IRuleBase ruleBase

execPoint

protected ExecutionPoint execPoint

context

protected IValidationContext context

workEstimate

protected int workEstimate

progress

protected int progress

notificationPercent

protected int notificationPercent

notificationIncrement

protected int notificationIncrement

lastNotification

protected int lastNotification

contextCache

protected Map contextCache
Constructor Detail

AbstractValidationProcess

public AbstractValidationProcess()
Method Detail

getProgress

public int getProgress()
returns the approximate progress relative to the amount of estimated work as an integer percentage. Returning a 0 means that a work estimate is available but there is no progress as of yet. Returning -1 means that no work estimate is available or that this process does not plan to support any sort of progress indication.

Specified by:
getProgress in interface IValidationProcess
Returns:
the current progress as a percentage of the estimated work, 0 if no progress has been make or-1 if not supported or not available

setProgress

protected void setProgress(int newProgress)

incrementProgress

protected void incrementProgress()
increments the progress value by one.


resetProgress

protected void resetProgress()

initProgressEstimates

protected void initProgressEstimates()

getNotificationPercent

public int getNotificationPercent()

setNotificationPercent

public void setNotificationPercent(int percent)

getWorkEstimate

public int getWorkEstimate()
returns an estimate on the amount of work required by this process. Returning -1 means that no work estimate is available or that this process does not plan to support any sort of progress indication.

Specified by:
getWorkEstimate in interface IValidationProcess
Returns:
estimate of work required by this process or-1 if not supported or not available

getRuleBase

public IRuleBase getRuleBase()
returns the IRuleBase used in this IValidationProcess.

Specified by:
getRuleBase in interface IValidationProcess
Returns:
the IRuleBase for this IValidationProcess

setRuleBase

public void setRuleBase(IRuleBase iRuleBase)
sets the IRuleBase used in this IValidationProcess.

Specified by:
setRuleBase in interface IValidationProcess
Parameters:
iRuleBase - -- the IRuleBase for this IValidationProcess

getExecutionPoint

public ExecutionPoint getExecutionPoint()
returns the ExecutionPoint triggering this IValidationProcess.

Specified by:
getExecutionPoint in interface IValidationProcess
Returns:
the ExecutionPoint for this IValidationProcess

setExecutionPoint

public void setExecutionPoint(ExecutionPoint executionPoint)
sets the ExecutionPoint used in this IValidationProcess.

Specified by:
setExecutionPoint in interface IValidationProcess
Parameters:
executionPoint - -- the ExecutionPoint for this IValidationProcess

setValidationContext

public void setValidationContext(IValidationContext valContext)
sets the IValidationContext used in this IValidationProcess.

Specified by:
setValidationContext in interface IValidationProcess
Parameters:
valContext - -- the IValidationContext for this IValidationProcess

getValidationContext

public IValidationContext getValidationContext()
returns the IValidationContext used in this IValidationProcess.

Specified by:
getValidationContext in interface IValidationProcess
Returns:
the IValidationContext for this IValidationProcess

isTerminated

protected boolean isTerminated()