com.carrotsearch.hppc.LongHashSet.add()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(90)

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

LongHashSet.add介绍

暂无

代码示例

代码示例来源:origin: carrotsearch/hppc

/**
 * Adds all elements from the given iterable to this set.
 * 
 * @return Returns the number of elements actually added as a result of this
 *         call (not previously present in the set).
 */
public int addAll(Iterable<? extends LongCursor> iterable) {
 int count = 0;
 for (LongCursor cursor : iterable) {
  if (add(cursor.value)) {
   count++;
  }
 }
 return count;
}

代码示例来源:origin: carrotsearch/hppc

/**
 * Adds all elements from the given list (vararg) to this set. 
 * 
 * @return Returns the number of elements actually added as a result of this
 *         call (not previously present in the set).
 */
/*  */
public final int addAll(long... elements) {
 ensureCapacity(elements.length);
 int count = 0;
 for (long e : elements) {
  if (add(e)) {
   count++;
  }
 }
 return count;
}

代码示例来源:origin: dremio/dremio-oss

public LongSet(NullableDateMilliHolder[] holders) {
 for(NullableDateMilliHolder h : holders) {
  if(h.isSet == 0) {
   // one null is never equal to another null.
   continue;
  }
  longSet.add(h.value);
 }
}

代码示例来源:origin: dremio/dremio-oss

public LongSet(NullableTimeStampMilliHolder[] holders) {
 for(NullableTimeStampMilliHolder h : holders) {
  if(h.isSet == 0) {
   // one null is never equal to another null.
   continue;
  }
  longSet.add(h.value);
 }
}

代码示例来源:origin: dremio/dremio-oss

public LongSet(NullableBigIntHolder[] holders) {
 for(NullableBigIntHolder h : holders) {
  if(h.isSet == 0) {
   // one null is never equal to another null.
   continue;
  }
  longSet.add(h.value);
 }
}

代码示例来源:origin: sirensolutions/siren-join

@Override
public void add(long term) {
 this.set.add(term);
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Adds all elements from the given iterable to this set.
 * 
 * @return Returns the number of elements actually added as a result of this
 *         call (not previously present in the set).
 */
public int addAll(Iterable<? extends LongCursor> iterable) {
 int count = 0;
 for (LongCursor cursor : iterable) {
  if (add(cursor.value)) {
   count++;
  }
 }
 return count;
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Adds all elements from the given list (vararg) to this set. 
 * 
 * @return Returns the number of elements actually added as a result of this
 *         call (not previously present in the set).
 */
/*  */
public final int addAll(long... elements) {
 ensureCapacity(elements.length);
 int count = 0;
 for (long e : elements) {
  if (add(e)) {
   count++;
  }
 }
 return count;
}

代码示例来源:origin: sirensolutions/siren-join

private void readFromBytes(BytesRef bytes) {
 // Read pruned flag
 this.setIsPruned(bytes.bytes[bytes.offset++] == 1 ? true : false);
 // Read size fo the set
 int size = Bytes.readInt(bytes);
 // Read terms
 // Scatter set is slightly more efficient than the hash set, but should be used only for lookups,
 // not for merging
 set = new LongScatterSet(size);
 for (int i = 0; i < size; i++) {
  set.add(Bytes.readLong(bytes));
 }
}

代码示例来源:origin: sirensolutions/siren-join

@Override
public void readFrom(StreamInput in) throws IOException {
 this.setIsPruned(in.readBoolean());
 int size = in.readInt();
 set = new CircuitBreakerLongHashSet(size);
 for (long i = 0; i < size; i++) {
  set.add(in.readLong());
 }
}

相关文章