BasicRouteDirector.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:purecloud-iot 作者:
/**
 * Provides the next step.
 *
 * @param plan      the planned route
 * @param fact      the currently established route, or
 *                  {@code null} if nothing is established
 *
 * @return  one of the constants defined in this class, indicating
 *          either the next step to perform, or success, or failure.
 *          0 is for success, a negative value for failure.
 */
@Override
public int nextStep(final RouteInfo plan, final RouteInfo fact) {
    Args.notNull(plan, "Planned route");

    int step = UNREACHABLE;

    if ((fact == null) || (fact.getHopCount() < 1)) {
        step = firstStep(plan);
    } else if (plan.getHopCount() > 1) {
        step = proxiedStep(plan, fact);
    } else {
        step = directStep(plan, fact);
    }

    return step;

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号