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


Java AndroidVersion.equals方法代码示例

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


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

示例1: canBeUpdatedBy

import com.android.sdklib.AndroidVersion; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * <hr>
 * Doc packages are a bit different since there can only be one doc installed at
 * the same time.
 * <p/>
 * We now consider that docs for different APIs are NOT updates, e.g. doc for API N+1
 * is no longer considered an update for doc API N.
 * However docs that have the same API version (API level + codename) are considered
 * updates if they have a higher revision number (so 15 rev 2 is an update for 15 rev 1,
 * but is not an update for 14 rev 1.)
 */
@Override
public UpdateInfo canBeUpdatedBy(Package replacementPackage) {
    // check they are the same kind of object
    if (!(replacementPackage instanceof DocPackage)) {
        return UpdateInfo.INCOMPATIBLE;
    }

    DocPackage replacementDoc = (DocPackage)replacementPackage;

    AndroidVersion replacementVersion = replacementDoc.getAndroidVersion();

    // Check if they're the same exact (api and codename)
    if (replacementVersion.equals(mVersion)) {
        // exact same version, so check the revision level
        if (replacementPackage.getRevision().compareTo(this.getRevision()) > 0) {
            return UpdateInfo.UPDATE;
        }
    } else {
        // not the same version? we check if they have the same api level and the new one
        // is a preview, in which case it's also an update (since preview have the api level
        // of the _previous_ version.)
        if (replacementVersion.getApiLevel() == mVersion.getApiLevel() &&
                replacementVersion.isPreview()) {
            return UpdateInfo.UPDATE;
        }
    }

    // not an upgrade but not incompatible either.
    return UpdateInfo.NOT_UPDATE;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:43,代码来源:DocPackage.java

示例2: doesIdeAndroidSdkExist

import com.android.sdklib.AndroidVersion; //导入方法依赖的package包/类
/**
 * @return {@code true} if an IntelliJ SDK with the default naming convention already exists for the given Android build target.
 */
private static boolean doesIdeAndroidSdkExist(@NotNull IAndroidTarget target) {
  for (Sdk sdk : getEligibleAndroidSdks()) {
    IAndroidTarget platformTarget = getTarget(sdk);
    AndroidVersion version = target.getVersion();
    AndroidVersion existingVersion = platformTarget.getVersion();
    if (existingVersion.equals(version)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:IdeSdks.java


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