• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TypePair类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



TypePair类属于com.google.javascript.rhino.jstype.JSType包,在下文中一共展示了TypePair类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: caseEquality

import com.google.javascript.rhino.jstype.JSType.TypePair; //导入依赖的package包/类
private FlowScope caseEquality(Node left, Node right, FlowScope blindScope,
    Function<TypePair, TypePair> merging) {
  // left type
  JSType leftType = getTypeIfRefinable(left, blindScope);
  boolean leftIsRefineable;
  if (leftType != null) {
    leftIsRefineable = true;
  } else {
    leftIsRefineable = false;
    leftType = left.getJSType();
  }

  // right type
  JSType rightType = getTypeIfRefinable(right, blindScope);
  boolean rightIsRefineable;
  if (rightType != null) {
    rightIsRefineable = true;
  } else {
    rightIsRefineable = false;
    rightType = right.getJSType();
  }

  // merged types
  TypePair merged = merging.apply(new TypePair(leftType, rightType));

  // creating new scope
  if (merged != null &&
      ((leftIsRefineable && merged.typeA != null) ||
       (rightIsRefineable && merged.typeB != null))) {
    FlowScope informed = blindScope.createChildFlowScope();
    if (leftIsRefineable && merged.typeA != null) {
      declareNameInScope(informed, left, merged.typeA);
    }
    if (rightIsRefineable && merged.typeB != null) {
      declareNameInScope(informed, right, merged.typeB);
    }
    return informed;
  }
  return blindScope;
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:41,代码来源:SemanticReverseAbstractInterpreter.java


示例2: testGetTypeUnderEquality

import com.google.javascript.rhino.jstype.JSType.TypePair; //导入依赖的package包/类
private void testGetTypeUnderEquality(
    JSType t1, JSType t2, JSType t1Eq, JSType t2Eq) {
  // creating the pairs
  TypePair p12 = t1.getTypesUnderEquality(t2);
  TypePair p21 = t2.getTypesUnderEquality(t1);

  // t1Eq
  assertEquals(t1Eq, p12.typeA);
  assertEquals(t1Eq, p21.typeB);

  // t2Eq
  assertEquals(t2Eq, p12.typeB);
  assertEquals(t2Eq, p21.typeA);
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:15,代码来源:JSTypeTest.java


示例3: testGetTypesUnderInequality

import com.google.javascript.rhino.jstype.JSType.TypePair; //导入依赖的package包/类
private void testGetTypesUnderInequality(
    JSType t1, JSType t2, JSType t1Eq, JSType t2Eq) {
  // creating the pairs
  TypePair p12 = t1.getTypesUnderInequality(t2);
  TypePair p21 = t2.getTypesUnderInequality(t1);

  // t1Eq
  assertEquals(t1Eq, p12.typeA);
  assertEquals(t1Eq, p21.typeB);

  // t2Eq
  assertEquals(t2Eq, p12.typeB);
  assertEquals(t2Eq, p21.typeA);
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:15,代码来源:JSTypeTest.java


示例4: testGetTypeUnderEquality

import com.google.javascript.rhino.jstype.JSType.TypePair; //导入依赖的package包/类
private void testGetTypeUnderEquality(
    JSType t1, JSType t2, JSType t1Eq, JSType t2Eq) {
  // creating the pairs
  TypePair p12 = t1.getTypesUnderEquality(t2);
  TypePair p21 = t2.getTypesUnderEquality(t1);

  // t1Eq
  assertTypeEquals(t1Eq, p12.typeA);
  assertTypeEquals(t1Eq, p21.typeB);

  // t2Eq
  assertTypeEquals(t2Eq, p12.typeB);
  assertTypeEquals(t2Eq, p21.typeA);
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:15,代码来源:JSTypeTest.java


示例5: testGetTypesUnderInequality

import com.google.javascript.rhino.jstype.JSType.TypePair; //导入依赖的package包/类
private void testGetTypesUnderInequality(
    JSType t1, JSType t2, JSType t1Eq, JSType t2Eq) {
  // creating the pairs
  TypePair p12 = t1.getTypesUnderInequality(t2);
  TypePair p21 = t2.getTypesUnderInequality(t1);

  // t1Eq
  assertTypeEquals(t1Eq, p12.typeA);
  assertTypeEquals(t1Eq, p21.typeB);

  // t2Eq
  assertTypeEquals(t2Eq, p12.typeB);
  assertTypeEquals(t2Eq, p21.typeA);
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:15,代码来源:JSTypeTest.java


示例6: apply

import com.google.javascript.rhino.jstype.JSType.TypePair; //导入依赖的package包/类
@Override
public TypePair apply(TypePair p) {
  if (p.typeA == null || p.typeB == null) {
    return null;
  }
  return p.typeA.getTypesUnderEquality(p.typeB);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:8,代码来源:SemanticReverseAbstractInterpreter.java


示例7: caseEquality

import com.google.javascript.rhino.jstype.JSType.TypePair; //导入依赖的package包/类
private FlowScope caseEquality(Node left, Node right, FlowScope blindScope,
    Function<TypePair, TypePair> merging) {
  // left type
  JSType leftType = getTypeIfRefinable(left, blindScope);
  boolean leftIsRefineable;
  if (leftType != null) {
    leftIsRefineable = true;
  } else {
    leftIsRefineable = false;
    leftType = left.getJSType();
  }

  // right type
  JSType rightType = getTypeIfRefinable(right, blindScope);
  boolean rightIsRefineable;
  if (rightType != null) {
    rightIsRefineable = true;
  } else {
    rightIsRefineable = false;
    rightType = right.getJSType();
  }

  // merged types
  TypePair merged = merging.apply(new TypePair(leftType, rightType));

  // creating new scope
  if (merged != null) {
    return maybeRestrictTwoNames(
        blindScope,
        left, leftType, leftIsRefineable ? merged.typeA : null,
        right, rightType, rightIsRefineable ? merged.typeB : null);
  }
  return blindScope;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:35,代码来源:SemanticReverseAbstractInterpreter.java


示例8: apply

import com.google.javascript.rhino.jstype.JSType.TypePair; //导入依赖的package包/类
public TypePair apply(TypePair p) {
  if (p.typeA == null || p.typeB == null) {
    return null;
  }
  return p.typeA.getTypesUnderEquality(p.typeB);
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:7,代码来源:SemanticReverseAbstractInterpreter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Assert类代码示例发布时间:2022-05-23
下一篇:
Java AsyncTask类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap