本文整理汇总了Java中gnu.trove.set.hash.TLongHashSet.equals方法的典型用法代码示例。如果您正苦于以下问题:Java TLongHashSet.equals方法的具体用法?Java TLongHashSet.equals怎么用?Java TLongHashSet.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.set.hash.TLongHashSet
的用法示例。
在下文中一共展示了TLongHashSet.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: set
import gnu.trove.set.hash.TLongHashSet; //导入方法依赖的package包/类
/**
* Set the ids
* @param ids
* @return True if the ids changed.
*/
public synchronized boolean set(long [] ids){
TLongHashSet oldSet = new TLongHashSet(selectedGlobalRowIds);
selectedGlobalRowIds.clear();
if(ids!=null){
selectedGlobalRowIds.addAll(ids);
}
return !oldSet.equals(selectedGlobalRowIds);
}
示例2: build
import gnu.trove.set.hash.TLongHashSet; //导入方法依赖的package包/类
public FastContainedPointsQuadtree build(GeometryFactory factory, InsertedListener listener){
if(e==null){
// no points ... return dummy empty tree which will return nothing from all queries
return new FastContainedPointsQuadtree(new CacheKey(points), null);
}
Node root = new Node(e, factory);
// small object to count number added
class Counter{
long count=0;
}
Counter counter = new Counter();
points.forEach(new BiConsumer<Coordinate, TLongHashSet>() {
@Override
public void accept(Coordinate t, TLongHashSet u) {
root.insert(t, u.toArray());
if(listener!=null){
listener.inserted(t, counter.count);
}
counter.count++;
}
});
// check root ok - all should be contained
TLongHashSet allContained = new TLongHashSet();
root.fetchIds(allContained);
if(allContained.equals(testids)==false){
throw new RuntimeException("Error building points lookup quadtree");
}
if(root.countCoords()!=testCoords.size()){
throw new RuntimeException("Error building points lookup quadtree");
}
return new FastContainedPointsQuadtree(new CacheKey(points), root);
}