本文整理了Java中org.bitcoinj.core.Address.compareTo()
方法的一些代码示例,展示了Address.compareTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.compareTo()
方法的具体详情如下:
包路径:org.bitcoinj.core.Address
类名称:Address
方法名:compareTo
暂无
代码示例来源:origin: DanielKrawisz/Shufflepuff
@Override
public int compareTo(Address o) {
if (!(o instanceof AddressImpl)) {
throw new IllegalArgumentException("unable to compare with other address");
}
return address.compareTo(((AddressImpl)o).address);
}
代码示例来源:origin: greenaddress/GreenBits
@Test
public void comparisonCloneEqualTo() throws Exception {
Address a = Address.fromBase58(mainParams, "1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX");
Address b = a.clone();
int result = a.compareTo(b);
assertEquals(0, result);
}
代码示例来源:origin: greenaddress/GreenBits
@Test
public void comparisonGreaterThan() throws Exception {
Address a = Address.fromBase58(mainParams, "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P");
Address b = Address.fromBase58(mainParams, "1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX");
int result = a.compareTo(b);
assertTrue(result > 0);
}
代码示例来源:origin: greenaddress/GreenBits
@Test
public void comparisonEqualTo() throws Exception {
Address a = Address.fromBase58(mainParams, "1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX");
Address b = a.clone();
int result = a.compareTo(b);
assertEquals(0, result);
}
代码示例来源:origin: greenaddress/GreenBits
@Test
public void comparisonLessThan() throws Exception {
Address a = Address.fromBase58(mainParams, "1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX");
Address b = Address.fromBase58(mainParams, "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P");
int result = a.compareTo(b);
assertTrue(result < 0);
}
代码示例来源:origin: greenaddress/GreenBits
@Test
public void comparisonBytesVsString() throws Exception {
// TODO: To properly test this we need a much larger data set
Address a = Address.fromBase58(mainParams, "1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX");
Address b = Address.fromBase58(mainParams, "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P");
int resultBytes = a.compareTo(b);
int resultsString = a.toString().compareTo(b.toString());
assertTrue( resultBytes < 0 );
assertTrue( resultsString < 0 );
}
}
内容来源于网络,如有侵权,请联系作者删除!