org.eclipse.jdt.core.dom.CompilationUnit.equals()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中org.eclipse.jdt.core.dom.CompilationUnit.equals()方法的一些代码示例,展示了CompilationUnit.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CompilationUnit.equals()方法的具体详情如下:
包路径:org.eclipse.jdt.core.dom.CompilationUnit
类名称:CompilationUnit
方法名:equals

CompilationUnit.equals介绍

暂无

代码示例

代码示例来源:origin: forge/roaster

return false;
else if (!unit.equals(other.unit))
  return false;
return true;

代码示例来源:origin: org.jboss.forge/roaster-jdt

return false;
else if (!unit.equals(other.unit))
  return false;
return true;

代码示例来源:origin: org.jboss.forge/roaster-jdt

return false;
else if (!unit.equals(other.unit))
  return false;
return true;

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

/**
 * Returns an AST for the given compilation unit handle.<br>
 * If this is the unit containing the selection or the unit in which the factory
 * is to reside, checks the appropriate field (<code>fCU</code> or <code>fFactoryCU</code>,
 * respectively) and initializes the field with a new AST only if not already done.
 */
private CompilationUnit getASTFor(ICompilationUnit unitHandle) {
  if (unitHandle.equals(fCUHandle)) { // is this the unit containing the selection?
    if (fCU == null) {
      fCU= ASTCreator.createAST(unitHandle, null);
      if (fCU.equals(fFactoryUnitHandle)) // if selection unit and factory unit are the same...
        fFactoryCU= fCU; // ...make sure the factory unit gets initialized
    }
    return fCU;
  } else if (unitHandle.equals(fFactoryUnitHandle)) { // is this the "factory unit"?
    if (fFactoryCU == null)
      fFactoryCU= ASTCreator.createAST(unitHandle, null);
    return fFactoryCU;
  } else
    return ASTCreator.createAST(unitHandle, null);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * @param unitHandle
 * @return an AST for the given compilation unit handle.<br>
 * If this is the unit containing the selection or the unit in which the factory
 * is to reside, checks the appropriate field (<code>fCU</code> or <code>fFactoryCU</code>,
 * respectively) and initializes the field with a new AST only if not already done.
 */
private CompilationUnit getASTFor(ICompilationUnit unitHandle) {
  if (unitHandle.equals(fCUHandle)) { // is this the unit containing the selection?
    if (fCU == null) {
      fCU= ASTCreator.createAST(unitHandle, null);
      if (fCU.equals(fFactoryUnitHandle)) // if selection unit and factory unit are the same...
        fFactoryCU= fCU; // ...make sure the factory unit gets initialized
    }
    return fCU;
  } else if (unitHandle.equals(fFactoryUnitHandle)) { // is this the "factory unit"?
    if (fFactoryCU == null)
      fFactoryCU= ASTCreator.createAST(unitHandle, null);
    return fFactoryCU;
  } else
    return ASTCreator.createAST(unitHandle, null);
}

相关文章

微信公众号

最新文章

更多