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


Java BooleanLiteralSet.union方法代码示例

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


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

示例1: joinBooleanOutcomes

import com.google.javascript.rhino.jstype.BooleanLiteralSet; //导入方法依赖的package包/类
private static BooleanLiteralSet joinBooleanOutcomes(
    boolean isAnd, BooleanLiteralSet left, BooleanLiteralSet right) {
  // A truthy value on the lhs of an {@code &&} can never make it to the
  // result. Same for a falsy value on the lhs of an {@code ||}.
  // Hence the intersection.
  return right.union(left.intersection(BooleanLiteralSet.get(!isAnd)));
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:8,代码来源:TypeInference.java

示例2: getBooleanOutcomes

import com.google.javascript.rhino.jstype.BooleanLiteralSet; //导入方法依赖的package包/类
/**
 * Infers the boolean literal set that can be taken by a
 * short-circuiting binary operation ({@code &&} or {@code ||}).
 * @param left the set of possible {@code ToBoolean} predicate results for
 *    the expression on the left side of the operator
 * @param right the set of possible {@code ToBoolean} predicate results for
 *    the expression on the right side of the operator
 * @param condition the left side {@code ToBoolean} predicate result that
 *    causes the right side to get evaluated (i.e. not short-circuited)
 * @return a set of possible {@code ToBoolean} predicate results for the
 *    entire expression
 */
static BooleanLiteralSet getBooleanOutcomes(BooleanLiteralSet left,
    BooleanLiteralSet right, boolean condition) {
  return right.union(left.intersection(BooleanLiteralSet.get(!condition)));
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:17,代码来源:TypeInference.java


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