• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Arrays类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中it.unimi.dsi.fastutil.Arrays的典型用法代码示例。如果您正苦于以下问题:Java Arrays类的具体用法?Java Arrays怎么用?Java Arrays使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Arrays类属于it.unimi.dsi.fastutil包,在下文中一共展示了Arrays类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: removeElements

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
/** Removes elements of this type-specific list using optimized system calls.
 *
 * @param from the start index (inclusive).
 * @param to the end index (exclusive).
 */
public void removeElements( final int from, final int to ) {
 Arrays.ensureFromTo( size, from, to );
 System.arraycopy( a, to, a, from, size - to );
 size -= ( to - from );
 int i = to - from;
 while( i-- != 0 ) a[ size + i ] = null;
}
 
开发者ID:kkrugler,项目名称:yalder,代码行数:13,代码来源:ObjectArrayList.java


示例2: limitOrderBy

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
private static List<Map.Entry<String, FacetCounter>> limitOrderBy(FacetField facetField,
		List<Map.Entry<String, FacetCounter>> list) {
	final FacetSorter facetSorter = FacetSorter.getSorter(list, facetField.getOrderBy());
	if (facetSorter == null)
		return list;
	Arrays.quickSort(0, list.size(), facetSorter, facetSorter);
	final Integer limit = facetField.getLimit();
	if (limit == null)
		return list;
	if (list.size() <= limit)
		return list;
	return list.subList(0, limit);

}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:15,代码来源:Facet.java


示例3: hashCode

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public int hashCode( final K[] o ) {
 return java.util.Arrays.hashCode( o );
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:4,代码来源:ObjectArrays.java


示例4: equals

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public boolean equals( final K[] a, final K[] b ) {
 return java.util.Arrays.equals( a, b );
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:4,代码来源:ObjectArrays.java


示例5: hashCode

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public int hashCode( final long[] o ) {
 return java.util.Arrays.hashCode( o );
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:4,代码来源:LongArrays.java


示例6: equals

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public boolean equals( final long[] a, final long[] b ) {
 return java.util.Arrays.equals( a, b );
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:4,代码来源:LongArrays.java


示例7: hashCode

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public int hashCode( final int[] o ) {
 return java.util.Arrays.hashCode( o );
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:4,代码来源:IntArrays.java


示例8: equals

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public boolean equals( final int[] a, final int[] b ) {
 return java.util.Arrays.equals( a, b );
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:4,代码来源:IntArrays.java


示例9: hashCode

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public int hashCode( final boolean[] o ) {
 return java.util.Arrays.hashCode( o );
}
 
开发者ID:kkrugler,项目名称:yalder,代码行数:4,代码来源:BooleanArrays.java


示例10: equals

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public boolean equals( final boolean[] a, final boolean[] b ) {
 return java.util.Arrays.equals( a, b );
}
 
开发者ID:kkrugler,项目名称:yalder,代码行数:4,代码来源:BooleanArrays.java


示例11: removeElements

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
/** Removes elements of this type-specific list using optimized system calls.
 *
 * @param from the start index (inclusive).
 * @param to the end index (exclusive).
 */
public void removeElements( final int from, final int to ) {
 Arrays.ensureFromTo( size, from, to );
 System.arraycopy( a, to, a, from, size - to );
 size -= ( to - from );
}
 
开发者ID:kkrugler,项目名称:yalder,代码行数:11,代码来源:IntArrayList.java


示例12: quickSort

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public void quickSort(Timer timer) {
	int numFound = collector.getSize();
	Timer t = new Timer(timer, "Sort (quicksort): " + numFound);
	Arrays.parallelQuickSort(0, numFound, this, collector);
	t.end(null);
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:7,代码来源:SorterAbstract.java


示例13: SnippetVectorSort

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
private SnippetVectorSort(final SnippetVector[] vectors) {
	this.vectors = vectors;
	Arrays.quickSort(0, vectors.length, this, this);
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:5,代码来源:SnippetVectors.java


示例14: sortByOffset

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
public void sortByOffset() {
	Arrays.quickSort(0, termQueryItems.size(), this, this);
}
 
开发者ID:jaeksoft,项目名称:opensearchserver,代码行数:4,代码来源:TokenQueryFilter.java


示例15: grow

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
/** Grows the given array to the maximum between the given length and
 * the current length multiplied by two, provided that the given
 * length is larger than the current length.
 *
 * <P>If you want complete control on the array growth, you
 * should probably use <code>ensureCapacity()</code> instead.
 *
 * @param array an array.
 * @param length the new minimum length for this array.
 * @return <code>array</code>, if it can contain <code>length</code>
 * entries; otherwise, an array with
 * max(<code>length</code>,<code>array.length</code>/&phi;) entries whose first
 * <code>array.length</code> entries are the same as those of <code>array</code>.
 * */
public static <K> K[] grow( final K[] array, final int length ) {
 if ( length > array.length ) {
  final int newLength = (int)Math.max( Math.min( 2L * array.length, Arrays.MAX_ARRAY_SIZE ), length );
  final K t[] =
   newArray( array, newLength );
  System.arraycopy( array, 0, t, 0, array.length );
  return t;
 }
 return array;
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:25,代码来源:ObjectArrays.java


示例16: grow

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
/** Grows the given array to the maximum between the given length and
 * the current length multiplied by two, provided that the given
 * length is larger than the current length.
 *
 * <P>If you want complete control on the array growth, you
 * should probably use <code>ensureCapacity()</code> instead.
 *
 * @param array an array.
 * @param length the new minimum length for this array.
 * @return <code>array</code>, if it can contain <code>length</code>
 * entries; otherwise, an array with
 * max(<code>length</code>,<code>array.length</code>/&phi;) entries whose first
 * <code>array.length</code> entries are the same as those of <code>array</code>.
 * */
public static long[] grow( final long[] array, final int length ) {
 if ( length > array.length ) {
  final int newLength = (int)Math.max( Math.min( 2L * array.length, Arrays.MAX_ARRAY_SIZE ), length );
  final long t[] =
   new long[ newLength ];
  System.arraycopy( array, 0, t, 0, array.length );
  return t;
 }
 return array;
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:25,代码来源:LongArrays.java


示例17: grow

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
/** Grows the given array to the maximum between the given length and
 * the current length multiplied by two, provided that the given
 * length is larger than the current length.
 *
 * <P>If you want complete control on the array growth, you
 * should probably use <code>ensureCapacity()</code> instead.
 *
 * @param array an array.
 * @param length the new minimum length for this array.
 * @return <code>array</code>, if it can contain <code>length</code>
 * entries; otherwise, an array with
 * max(<code>length</code>,<code>array.length</code>/&phi;) entries whose first
 * <code>array.length</code> entries are the same as those of <code>array</code>.
 * */
public static int[] grow( final int[] array, final int length ) {
 if ( length > array.length ) {
  final int newLength = (int)Math.max( Math.min( 2L * array.length, Arrays.MAX_ARRAY_SIZE ), length );
  final int t[] =
   new int[ newLength ];
  System.arraycopy( array, 0, t, 0, array.length );
  return t;
 }
 return array;
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:25,代码来源:IntArrays.java


示例18: grow

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
/** Grows the given array to the maximum between the given length and
 * the current length multiplied by two, provided that the given
 * length is larger than the current length.
 *
 * <P>If you want complete control on the array growth, you
 * should probably use <code>ensureCapacity()</code> instead.
 *
 * @param array an array.
 * @param length the new minimum length for this array.
 * @return <code>array</code>, if it can contain <code>length</code>
 * entries; otherwise, an array with
 * max(<code>length</code>,<code>array.length</code>/&phi;) entries whose first
 * <code>array.length</code> entries are the same as those of <code>array</code>.
 * */
public static boolean[] grow( final boolean[] array, final int length ) {
 if ( length > array.length ) {
  final int newLength = (int)Math.max( Math.min( 2L * array.length, Arrays.MAX_ARRAY_SIZE ), length );
  final boolean t[] =
   new boolean[ newLength ];
  System.arraycopy( array, 0, t, 0, array.length );
  return t;
 }
 return array;
}
 
开发者ID:kkrugler,项目名称:yalder,代码行数:25,代码来源:BooleanArrays.java


示例19: removeElements

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
/**
 * Removes elements of this type-specific list using optimized system calls.
 * 
 * @param from
 *            the start index (inclusive).
 * @param to
 *            the end index (exclusive).
 */

public void removeElements(final int from, final int to) {
	Arrays.ensureFromTo(size, from, to);
	System.arraycopy(a, to, a, from, size - to);
	size -= to - from;
}
 
开发者ID:jsubercaze,项目名称:simhashdb,代码行数:15,代码来源:MyLongArrayList.java


示例20: ensureFromTo

import it.unimi.dsi.fastutil.Arrays; //导入依赖的package包/类
/** Ensures that a range given by its first (inclusive) and last (exclusive) elements fits an array.
 *
 * <P>This method may be used whenever an array range check is needed.
 *
 * @param a an array.
 * @param from a start index (inclusive).
 * @param to an end index (exclusive).
 * @throws IllegalArgumentException if <code>from</code> is greater than <code>to</code>.
 * @throws ArrayIndexOutOfBoundsException if <code>from</code> or <code>to</code> are greater than the array length or negative.
 */
public static <K> void ensureFromTo( final K[] a, final int from, final int to ) {
 Arrays.ensureFromTo( a.length, from, to );
}
 
开发者ID:aikar,项目名称:fastutil-lite,代码行数:14,代码来源:ObjectArrays.java



注:本文中的it.unimi.dsi.fastutil.Arrays类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RouterMicrodescriptor类代码示例发布时间:2022-05-23
下一篇:
Java Tag类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap