本文整理了Java中it.unimi.dsi.fastutil.ints.IntSet.toArray()
方法的一些代码示例,展示了IntSet.toArray()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IntSet.toArray()
方法的具体详情如下:
包路径:it.unimi.dsi.fastutil.ints.IntSet
类名称:IntSet
方法名:toArray
暂无
代码示例来源:origin: apache/incubator-pinot
@Override
public void seal() {
sealed = true;
sortedIntList = new int[rawIntSet.size()];
rawIntSet.toArray(sortedIntList);
Arrays.sort(sortedIntList);
if (sortedIntList.length == 0) {
min = null;
max = null;
return;
}
// Update min/max based on raw docs.
min = sortedIntList[0];
max = sortedIntList[sortedIntList.length - 1];
// Merge the raw and aggregated docs, so stats for dictionary creation are collected correctly.
int numAggregated = aggregatedIntSet.size();
if (numAggregated > 0) {
rawIntSet.addAll(aggregatedIntSet);
sortedIntList = new int[rawIntSet.size()];
rawIntSet.toArray(sortedIntList);
Arrays.sort(sortedIntList);
}
}
}
代码示例来源:origin: com.senseidb.zoie/zoie-core
public Object[] toArray() {
return _set.toArray();
}
代码示例来源:origin: com.senseidb.zoie/zoie-core
public <T> T[] toArray(T[] a) {
return _set.toArray(a);
}
代码示例来源:origin: senseidb/zoie
public int[] toArray(int[] a) {
return _set.toArray(a);
}
代码示例来源:origin: com.linkedin.zoie/zoie-core
public int[] toArray(int[] a)
{
return _set.toArray(a);
}
代码示例来源:origin: com.senseidb.zoie/zoie-core
public int[] toArray(int[] a) {
return _set.toArray(a);
}
代码示例来源:origin: senseidb/zoie
public Object[] toArray() {
return _set.toArray();
}
代码示例来源:origin: com.linkedin.zoie/zoie-core
public Object[] toArray()
{
return _set.toArray();
}
代码示例来源:origin: com.linkedin.zoie/zoie-core
public <T> T[] toArray(T[] a)
{
return _set.toArray(a);
}
代码示例来源:origin: senseidb/zoie
public <T> T[] toArray(T[] a) {
return _set.toArray(a);
}
代码示例来源:origin: it.unimi.di/mg4j
/** Selects a subset of size at most <code>card</code> from <code>s</code>.
*
* @param s the set from which the subset should be extracted.
* @param card the maximum cardinality allowed for the extracted set.
* @return a subset of s selected at random.
*/
private IntSet select( final IntSet s, final int card ) {
if ( card == 0 ) return IntSets.EMPTY_SET;
else if ( card >= s.size() ) return s;
else {
int n = s.size();
final int[] node = new int[ n ];
s.toArray( node );
IntArrays.quickSort( node, new AbstractIntComparator() {
private static final long serialVersionUID = 1L;
@Override
public int compare( int x, int y ) {
return nodePermutation[ x ] - nodePermutation[ y ];
}
});
IntSet result = new IntOpenHashSet();
for ( int i = 0; i < card; i++ ) result.add( node[ i ] );
return result;
}
}
内容来源于网络,如有侵权,请联系作者删除!