com.android.dx.rop.annotation.NameValuePair.compareTo()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(77)

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

NameValuePair.compareTo介绍

[英]Instances of this class compare in name-major and value-minor order.
[中]该类的实例按名称主次顺序进行比较。

代码示例

代码示例来源:origin: com.android.tools.build/builder

/** {@inheritDoc} */
public int compareTo(Annotation other) {
  int result = type.compareTo(other.type);
  if (result != 0) {
    return result;
  }
  result = visibility.compareTo(other.visibility);
  if (result != 0) {
    return result;
  }
  Iterator<NameValuePair> thisIter = elements.values().iterator();
  Iterator<NameValuePair> otherIter = other.elements.values().iterator();
  while (thisIter.hasNext() && otherIter.hasNext()) {
    NameValuePair thisOne = thisIter.next();
    NameValuePair otherOne = otherIter.next();
    result = thisOne.compareTo(otherOne);
    if (result != 0) {
      return result;
    }
  }
  if (thisIter.hasNext()) {
    return 1;
  } else if (otherIter.hasNext()) {
    return -1;
  }
  return 0;
}

代码示例来源:origin: nikita36078/J2ME-Loader

/** {@inheritDoc} */
@Override
public int compareTo(Annotation other) {
  int result = type.compareTo(other.type);
  if (result != 0) {
    return result;
  }
  result = visibility.compareTo(other.visibility);
  if (result != 0) {
    return result;
  }
  Iterator<NameValuePair> thisIter = elements.values().iterator();
  Iterator<NameValuePair> otherIter = other.elements.values().iterator();
  while (thisIter.hasNext() && otherIter.hasNext()) {
    NameValuePair thisOne = thisIter.next();
    NameValuePair otherOne = otherIter.next();
    result = thisOne.compareTo(otherOne);
    if (result != 0) {
      return result;
    }
  }
  if (thisIter.hasNext()) {
    return 1;
  } else if (otherIter.hasNext()) {
    return -1;
  }
  return 0;
}

代码示例来源:origin: com.android/dx

/** {@inheritDoc} */
public int compareTo(Annotation other) {
  int result = type.compareTo(other.type);
  if (result != 0) {
    return result;
  }
  result = visibility.compareTo(other.visibility);
  if (result != 0) {
    return result;
  }
  Iterator<NameValuePair> thisIter = elements.values().iterator();
  Iterator<NameValuePair> otherIter = other.elements.values().iterator();
  while (thisIter.hasNext() && otherIter.hasNext()) {
    NameValuePair thisOne = thisIter.next();
    NameValuePair otherOne = otherIter.next();
    result = thisOne.compareTo(otherOne);
    if (result != 0) {
      return result;
    }
  }
  if (thisIter.hasNext()) {
    return 1;
  } else if (otherIter.hasNext()) {
    return -1;
  }
  return 0;
}

代码示例来源:origin: gdpancheng/LoonAndroid3

/** {@inheritDoc} */
public int compareTo(Annotation other) {
  int result = type.compareTo(other.type);
  if (result != 0) {
    return result;
  }
  result = visibility.compareTo(other.visibility);
  if (result != 0) {
    return result;
  }
  Iterator<NameValuePair> thisIter = elements.values().iterator();
  Iterator<NameValuePair> otherIter = other.elements.values().iterator();
  while (thisIter.hasNext() && otherIter.hasNext()) {
    NameValuePair thisOne = thisIter.next();
    NameValuePair otherOne = otherIter.next();
    result = thisOne.compareTo(otherOne);
    if (result != 0) {
      return result;
    }
  }
  if (thisIter.hasNext()) {
    return 1;
  } else if (otherIter.hasNext()) {
    return -1;
  }
  return 0;
}

代码示例来源:origin: com.google.android.tools/dx

/** {@inheritDoc} */
public int compareTo(Annotation other) {
  int result = type.compareTo(other.type);
  if (result != 0) {
    return result;
  }
  result = visibility.compareTo(other.visibility);
  if (result != 0) {
    return result;
  }
  Iterator<NameValuePair> thisIter = elements.values().iterator();
  Iterator<NameValuePair> otherIter = other.elements.values().iterator();
  while (thisIter.hasNext() && otherIter.hasNext()) {
    NameValuePair thisOne = thisIter.next();
    NameValuePair otherOne = otherIter.next();
    result = thisOne.compareTo(otherOne);
    if (result != 0) {
      return result;
    }
  }
  if (thisIter.hasNext()) {
    return 1;
  } else if (otherIter.hasNext()) {
    return -1;
  }
  return 0;
}

代码示例来源:origin: com.google.dexmaker/dexmaker-dx

/** {@inheritDoc} */
public int compareTo(Annotation other) {
  int result = type.compareTo(other.type);
  if (result != 0) {
    return result;
  }
  result = visibility.compareTo(other.visibility);
  if (result != 0) {
    return result;
  }
  Iterator<NameValuePair> thisIter = elements.values().iterator();
  Iterator<NameValuePair> otherIter = other.elements.values().iterator();
  while (thisIter.hasNext() && otherIter.hasNext()) {
    NameValuePair thisOne = thisIter.next();
    NameValuePair otherOne = otherIter.next();
    result = thisOne.compareTo(otherOne);
    if (result != 0) {
      return result;
    }
  }
  if (thisIter.hasNext()) {
    return 1;
  } else if (otherIter.hasNext()) {
    return -1;
  }
  return 0;
}

代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx

/** {@inheritDoc} */
@Override
public int compareTo(Annotation other) {
  int result = type.compareTo(other.type);
  if (result != 0) {
    return result;
  }
  result = visibility.compareTo(other.visibility);
  if (result != 0) {
    return result;
  }
  Iterator<NameValuePair> thisIter = elements.values().iterator();
  Iterator<NameValuePair> otherIter = other.elements.values().iterator();
  while (thisIter.hasNext() && otherIter.hasNext()) {
    NameValuePair thisOne = thisIter.next();
    NameValuePair otherOne = otherIter.next();
    result = thisOne.compareTo(otherOne);
    if (result != 0) {
      return result;
    }
  }
  if (thisIter.hasNext()) {
    return 1;
  } else if (otherIter.hasNext()) {
    return -1;
  }
  return 0;
}

代码示例来源:origin: dragome/dragome-sdk

/** {@inheritDoc} */
public int compareTo(Annotation other) {
  int result = type.compareTo(other.type);
  if (result != 0) {
    return result;
  }
  result = visibility.compareTo(other.visibility);
  if (result != 0) {
    return result;
  }
  Iterator<NameValuePair> thisIter = elements.values().iterator();
  Iterator<NameValuePair> otherIter = other.elements.values().iterator();
  while (thisIter.hasNext() && otherIter.hasNext()) {
    NameValuePair thisOne = thisIter.next();
    NameValuePair otherOne = otherIter.next();
    result = thisOne.compareTo(otherOne);
    if (result != 0) {
      return result;
    }
  }
  if (thisIter.hasNext()) {
    return 1;
  } else if (otherIter.hasNext()) {
    return -1;
  }
  return 0;
}

相关文章

微信公众号

最新文章

更多