aQute.bnd.version.Version.compareTo()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(164)

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

Version.compareTo介绍

暂无

代码示例

代码示例来源:origin: biz.aQute.bnd/bndlib

private void setVersion(Version version) {
    if (highest == null || (version.compareTo(highest) > 0))
      highest = version;
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
public boolean equals(Object ot) {
  if (!(ot instanceof Version))
    return false;
  return compareTo((Version) ot) == 0;
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle

@Override
public boolean equals(Object ot) {
  if (!(ot instanceof Version))
    return false;
  return compareTo((Version) ot) == 0;
}

代码示例来源:origin: org.apache.aries.spifly/org.apache.aries.spifly.dynamic.framework.extension

@Override
public boolean equals(Object ot) {
  if (!(ot instanceof Version))
    return false;
  return compareTo((Version) ot) == 0;
}

代码示例来源:origin: biz.aQute/bndlib

@Override
public boolean equals(Object ot) {
  if (!(ot instanceof Version))
    return false;
  return compareTo((Version) ot) == 0;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

@Override
public boolean equals(Object ot) {
  if (!(ot instanceof Version))
    return false;
  return compareTo((Version) ot) == 0;
}

代码示例来源:origin: biz.aQute.bnd/bnd

@Override
public boolean equals(Object ot) {
  if (!(ot instanceof Version))
    return false;
  return compareTo((Version) ot) == 0;
}

代码示例来源:origin: biz.aQute.bnd/bnd

private void setVersion(Version version) {
    if (highest == null || (version.compareTo(highest) > 0))
      highest = version;
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

@Override
public boolean equals(Object ot) {
  if (!(ot instanceof Version))
    return false;
  return compareTo((Version) ot) == 0;
}

代码示例来源:origin: biz.aQute.bnd/bnd

public int compareTo(PSpec o) {
  return version.compareTo(o.version);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
public int compareTo(RDImpl o) {
  if (this == o)
    return 0;
  int r = bsn.compareTo(o.bsn);
  if (r == 0)
    r = version.compareTo(o.version);
  return r;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

public int compareTo(RDImpl o) {
  if ( this == o)
    return 0;
  
  int r = bsn.compareTo(o.bsn);
  if ( r == 0)
    r = version.compareTo(o.version);
  
  return r;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

@Override
public int compareTo(RDImpl o) {
  if (this == o)
    return 0;
  int r = bsn.compareTo(o.bsn);
  if (r == 0)
    r = version.compareTo(o.version);
  return r;
}

代码示例来源:origin: biz.aQute.bnd/bnd

public int compareTo(RDImpl o) {
  if ( this == o)
    return 0;
  
  int r = bsn.compareTo(o.bsn);
  if ( r == 0)
    r = version.compareTo(o.version);
  
  return r;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

public int compare(
      ResourceDescriptor o1,
      ResourceDescriptor o2) {
    if (o1 == o2)
      return 0;
    int r = o1.bsn
        .compareTo(o2.bsn);
    if (r > 0)
      return 1;
    else if (r < 0)
      return -1;
    return o1.version
        .compareTo(o2.version);
  }
};

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

@Override
  public int compare(
    ResourceDescriptor o1,
    ResourceDescriptor o2) {
    if (o1 == o2)
      return 0;
    int r = o1.bsn
      .compareTo(o2.bsn);
    if (r > 0)
      return 1;
    else if (r < 0)
      return -1;
    return o1.version
      .compareTo(o2.version);
  }
};

代码示例来源:origin: biz.aQute/bndlib

public boolean includes(Version v) {
  if (!isRange()) {
    return low.compareTo(v) <= 0;
  }
  if (includeLow()) {
    if (v.compareTo(low) < 0)
      return false;
  } else if (v.compareTo(low) <= 0)
    return false;
  if (includeHigh()) {
    if (v.compareTo(high) > 0)
      return false;
  } else if (v.compareTo(high) >= 0)
    return false;
  return true;
}

代码示例来源:origin: biz.aQute/bndlib

public VersionRange(String string) {
  string = string.trim();
  Matcher m = RANGE.matcher(string);
  if (m.matches()) {
    start = m.group(1).charAt(0);
    String v1 = m.group(2);
    String v2 = m.group(10);
    low = new Version(v1);
    high = new Version(v2);
    end = m.group(18).charAt(0);
    if (low.compareTo(high) > 0)
      throw new IllegalArgumentException("Low Range is higher than High Range: " + low + "-" + high);
  } else
    high = low = new Version(string);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

private boolean replace(File target, final Version newVersion, Pattern pattern) throws IOException {
  String content = IO.collect(target);
  Matcher m = pattern.matcher(content);
  if (!m.find()) {
    return false;
  }
  Version oldVersion = new Version(m.group(1));
  if (newVersion.compareTo(oldVersion) == 0) {
    return true;
  }
  return replace(newVersion, content, m, target);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

private boolean replace(File target, final Version newVersion, Pattern pattern) throws IOException {
  String content = IO.collect(target);
  Matcher m = pattern.matcher(content);
  if (!m.find()) {
    return false;
  }
  Version oldVersion = new Version(m.group(1));
  if (newVersion.compareTo(oldVersion) == 0) {
    return true;
  }
  return replace(newVersion, content, m, target);
}

相关文章