当前位置: 首页>>代码示例>>Java>>正文


Java ProgressObserver.notifyEnd方法代码示例

本文整理汇总了Java中net.ssehub.easy.basics.progress.ProgressObserver.notifyEnd方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressObserver.notifyEnd方法的具体用法?Java ProgressObserver.notifyEnd怎么用?Java ProgressObserver.notifyEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.ssehub.easy.basics.progress.ProgressObserver的用法示例。


在下文中一共展示了ProgressObserver.notifyEnd方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: scanAll

import net.ssehub.easy.basics.progress.ProgressObserver; //导入方法依赖的package包/类
/**
 * Scans the entire environment starting at <code>root</code>.
 * 
 * @param observer the observer to be notified in case of progress, use 
 *   {@link ProgressObserver#NO_OBSERVER} if progress shall not be monitored
 * @throws VilException in case that creating / obtaining artifacts fails
 */
public void scanAll(ProgressObserver observer) throws VilException {
    if (null != base) {
        ITask task = observer.registerTask("creating complete artifact model for " + base.getAbsolutePath());
        int count = 0;
        if (ProgressObserver.NO_OBSERVER != observer) {
            count = scanAll(base, 0, null, null, null);
        }
        observer.notifyProgress(task, 0, count);
        List<VilException> errors = new ArrayList<VilException>();
        scanAll(base, 0, observer, task, errors);
        observer.notifyEnd(task);
        if (errors.size() > 0) {
            throw new VilException(errors);
        }
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:24,代码来源:ArtifactModel.java

示例2: progress

import net.ssehub.easy.basics.progress.ProgressObserver; //导入方法依赖的package包/类
/**
 * Notifies the tracer about the actual progress in order to inform the user.
 * 
 * @param actual the actual step (negative disables display)
 * @param max the maximum number of steps (may vary over time, negative disables display)
 * @param description an optional description of the step (may be <b>null</b>)
 */
public static void progress(int actual, int max, String description) {
    for (Map.Entry<ProgressObserver, TaskData> entry : PROGRESS_OBSERVERS.entrySet()) {
        ProgressObserver obs = entry.getKey();
        TaskData task = entry.getValue();
        boolean newTask = false;
        if (null == task) {
            newTask = true;
        } else if (null != description && !task.taskDescription.equals(description)) {
            // null == description -> keep task
            // not same description -> new task
            obs.notifyEnd(task.task);
            newTask = true;
        }
        if (newTask) {
            task = new TaskData();
            task.taskDescription = null == description ? "..." : description;
            task.task = obs.registerTask(task.taskDescription);
            entry.setValue(task);
        }
        obs.notifyProgress(task.task, actual, max);
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:30,代码来源:TracerFactory.java

示例3: unregisterProgressObserver

import net.ssehub.easy.basics.progress.ProgressObserver; //导入方法依赖的package包/类
/**
 * Unregisters the given progress observer.
 * 
 * @param observer the progress observer (ignored if <b>null</b>)
 */
public static void unregisterProgressObserver(ProgressObserver observer) {
    if (null != observer) {
        TaskData task = PROGRESS_OBSERVERS.remove(observer);
        if (null != task && null != task.task) {
            observer.notifyEnd(task.task);
        }
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:14,代码来源:TracerFactory.java

示例4: updateModelInformation

import net.ssehub.easy.basics.progress.ProgressObserver; //导入方法依赖的package包/类
/**
 * Updates the model information in all known locations.
 * 
 * @param observer an optional progress observer (use {@link ProgressObserver#NO_OBSERVER} but 
 *   not <b>null</b> in case that no observation is intended)
 * @throws ModelManagementException in case that the available information
 *   may be come inconsistent due to this update
 */
public synchronized void updateModelInformation(ProgressObserver observer) throws ModelManagementException {
    ModelInfoHolder<M> holder = new ModelInfoHolder<M>(availableModels);
    ITask task = observer.registerTask("update model model information");
    observer.notifyStart(task, locations.getLocationCount());
    Set<Location> done = new HashSet<Location>();
    for (int l = 0; l < locations.getLocationCount(); l++) {
        updateModelInformation(locations.getLocation(l), holder, observer, task, done);
        observer.notifyProgress(task, l);
    }
    observer.notifyEnd(task);
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:20,代码来源:ModelManagement.java


注:本文中的net.ssehub.easy.basics.progress.ProgressObserver.notifyEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。