本文整理汇总了Java中gnu.trove.list.linked.TIntLinkedList类的典型用法代码示例。如果您正苦于以下问题:Java TIntLinkedList类的具体用法?Java TIntLinkedList怎么用?Java TIntLinkedList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TIntLinkedList类属于gnu.trove.list.linked包,在下文中一共展示了TIntLinkedList类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: rehash
import gnu.trove.list.linked.TIntLinkedList; //导入依赖的package包/类
/**
* Expands the set to accommodate new values.
*
* @param newCapacity an <code>int</code> value
*/
@Override
protected void rehash(int newCapacity) {
TIntLinkedList oldOrder = new TIntLinkedList(order);
int oldSize = size();
Object oldSet[] = _set;
order.clear();
_set = new Object[newCapacity];
Arrays.fill(_set, FREE);
for (TIntIterator iterator = oldOrder.iterator(); iterator.hasNext();) {
int i = iterator.next();
E o = (E) oldSet[i];
if (o == FREE || o == REMOVED) {
throw new IllegalStateException("Iterating over empty location while rehashing");
}
if (o != FREE && o != REMOVED) {
int index = insertKey(o);
if (index < 0) { // everyone pays for this because some people can't RTFM
throwObjectContractViolation(_set[(-index - 1)], o, size(), oldSize, oldSet);
}
if (!order.add(index))
throw new IllegalStateException("Order not changed after insert");
}
}
}
开发者ID:JianpingZeng,项目名称:xcc,代码行数:36,代码来源:TLinkedHashSet.java
示例2: simMassInvInsert
import gnu.trove.list.linked.TIntLinkedList; //导入依赖的package包/类
public static ItemStack[] simMassInvInsert(final IInventory inv, final ItemStack[] items, final int side) {
final TIntLinkedList resultInd = new TIntLinkedList();
final ItemStack[] result = new ItemStack[items.length];
for (int i = 0; i < result.length; ++i) {
if (items[i] != null && items[i].stackSize > 0) {
result[i] = items[i].copy();
resultInd.add(i);
}
}
return simMassInvInsert_do(inv, side, resultInd, result);
}
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:12,代码来源:XUHelper.java
示例3: rehash
import gnu.trove.list.linked.TIntLinkedList; //导入依赖的package包/类
/**
* Expands the set to accommodate new values.
*
* @param newCapacity an <code>int</code> value
*/
@Override
@SuppressWarnings("unchecked")
protected void rehash(int newCapacity) {
TIntLinkedList oldOrder = new TIntLinkedList(order);
int oldSize = size();
Object oldSet[] = _set;
order.clear();
_set = new Object[newCapacity];
Arrays.fill(_set, FREE);
for (TIntIterator iterator = oldOrder.iterator(); iterator.hasNext();) {
int i = iterator.next();
E o = (E) oldSet[i];
if (o == FREE || o == REMOVED) {
throw new IllegalStateException("Iterating over empty location while rehashing");
}
if (o != FREE && o != REMOVED) {
int index = insertKey(o);
if (index < 0) { // everyone pays for this because some people can't RTFM
throwObjectContractViolation(_set[(-index - 1)], o, size(), oldSize, oldSet);
}
if (!order.add(index))
throw new IllegalStateException("Order not changed after insert");
}
}
}
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:37,代码来源:TLinkedHashSet.java
示例4: Predict
import gnu.trove.list.linked.TIntLinkedList; //导入依赖的package包/类
public Predict(int n) {
this.n = n;
scores = new TFloatLinkedList();
labels = new TIntLinkedList();
}
开发者ID:FudanNLP,项目名称:fnlp,代码行数:6,代码来源:Predict.java
示例5: analyse
import gnu.trove.list.linked.TIntLinkedList; //导入依赖的package包/类
private void analyse()
{
if (nBlinks == -1)
{
if (isEmpty())
{
nBlinks = 0;
onTimes = offTimes = null;
return;
}
if (results.size() == 1)
{
nBlinks = 1;
onTimes = new int[] { 1 };
offTimes = null;
return;
}
// Ensure in the correct time-order
sort();
TIntLinkedList on = new TIntLinkedList();
TIntLinkedList off = new TIntLinkedList();
nBlinks = 1;
int t1 = results.get(0).getFrame();
int onStart = t1;
for (int i = 0; i < results.size() - 1; i++)
{
int t2 = results.get(i + 1).getFrame();
int diff = t2 - t1;
if (diff > 1)
{
off.add(diff - 1);
on.add(t1 - onStart + 1);
nBlinks++;
onStart = t2;
}
t1 = t2;
}
on.add(t1 - onStart + 1);
onTimes = on.toArray();
offTimes = off.toArray();
}
}
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:46,代码来源:Trace.java
注:本文中的gnu.trove.list.linked.TIntLinkedList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论