本文整理汇总了Java中org.apache.cassandra.utils.ByteBufferUtil.compareUnsigned方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBufferUtil.compareUnsigned方法的具体用法?Java ByteBufferUtil.compareUnsigned怎么用?Java ByteBufferUtil.compareUnsigned使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.utils.ByteBufferUtil
的用法示例。
在下文中一共展示了ByteBufferUtil.compareUnsigned方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compareTo
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public int compareTo(ColumnIdentifier that)
{
int c = Long.compare(this.prefixComparison, that.prefixComparison);
if (c != 0)
return c;
if (this == that)
return 0;
return ByteBufferUtil.compareUnsigned(this.bytes, that.bytes);
}
示例2: equals
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null || !(obj instanceof DecoratedKey))
return false;
DecoratedKey other = (DecoratedKey)obj;
return ByteBufferUtil.compareUnsigned(getKey(), other.getKey()) == 0; // we compare faster than BB.equals for array backed BB
}
示例3: compareTo
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public int compareTo(PartitionPosition pos)
{
if (this == pos)
return 0;
// delegate to Token.KeyBound if needed
if (!(pos instanceof DecoratedKey))
return -pos.compareTo(this);
DecoratedKey otherKey = (DecoratedKey) pos;
int cmp = getToken().compareTo(otherKey.getToken());
return cmp == 0 ? ByteBufferUtil.compareUnsigned(getKey(), otherKey.getKey()) : cmp;
}
示例4: compareLongs
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public static int compareLongs(ByteBuffer o1, ByteBuffer o2)
{
if (!o1.hasRemaining() || !o2.hasRemaining())
return o1.hasRemaining() ? 1 : o2.hasRemaining() ? -1 : 0;
int diff = o1.get(o1.position()) - o2.get(o2.position());
if (diff != 0)
return diff;
return ByteBufferUtil.compareUnsigned(o1, o2);
}
示例5: compareCustom
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public int compareCustom(ByteBuffer o1, ByteBuffer o2)
{
if (!o1.hasRemaining() || !o2.hasRemaining())
return o1.hasRemaining() ? 1 : o2.hasRemaining() ? -1 : 0;
int diff = o1.get(o1.position()) - o2.get(o2.position());
if (diff != 0)
return diff;
return ByteBufferUtil.compareUnsigned(o1, o2);
}
示例6: compareCustom
import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public int compareCustom(ByteBuffer o1, ByteBuffer o2)
{
int diff = o1.get(o1.position()) - o2.get(o2.position());
if (diff != 0)
return diff;
return ByteBufferUtil.compareUnsigned(o1, o2);
}