本文整理汇总了Java中gnu.trove.list.TShortList.add方法的典型用法代码示例。如果您正苦于以下问题:Java TShortList.add方法的具体用法?Java TShortList.add怎么用?Java TShortList.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.list.TShortList
的用法示例。
在下文中一共展示了TShortList.add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bitset
import gnu.trove.list.TShortList; //导入方法依赖的package包/类
public static bitset bitset(boolean bits[]) {
TShortList resultList = new TShortArrayList();
boolean expect = true;
int bitsIdx = 0;
while (bitsIdx < bits.length) {
int end = bitsIdx;
while (end < bits.length && bits[end] == expect)
++end;
int len = end - bitsIdx;
while (len > 65535) {
bitsIdx += 65535;
len -= 65535;
resultList.add((short) 0xffff);
resultList.add((short) 0);
}
resultList.add((short) len);
bitsIdx += len;
expect = !expect;
}
return new bitset(resultList.toArray());
}
示例2: grep
import gnu.trove.list.TShortList; //导入方法依赖的package包/类
/** {@inheritDoc} */
public TShortList grep(TShortProcedure condition) {
TShortList ret = new TShortLinkedList();
for (TShortLink l = head; got(l); l = l.getNext()) {
if (condition.execute(l.getValue()))
ret.add(l.getValue());
}
return ret;
}
示例3: inverseGrep
import gnu.trove.list.TShortList; //导入方法依赖的package包/类
/** {@inheritDoc} */
public TShortList inverseGrep(TShortProcedure condition) {
TShortList ret = new TShortLinkedList();
for (TShortLink l = head; got(l); l = l.getNext()) {
if (!condition.execute(l.getValue()))
ret.add(l.getValue());
}
return ret;
}
示例4: grep
import gnu.trove.list.TShortList; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public TShortList grep(TShortProcedure condition) {
TShortList ret = new TShortLinkedList();
for (TShortLink l = head; got(l); l = l.getNext()) {
if (condition.execute(l.getValue()))
ret.add(l.getValue());
}
return ret;
}
示例5: inverseGrep
import gnu.trove.list.TShortList; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public TShortList inverseGrep(TShortProcedure condition) {
TShortList ret = new TShortLinkedList();
for (TShortLink l = head; got(l); l = l.getNext()) {
if (!condition.execute(l.getValue()))
ret.add(l.getValue());
}
return ret;
}
示例6: addTransaction
import gnu.trove.list.TShortList; //导入方法依赖的package包/类
@Override
public void addTransaction(final int item, int transaction) {
if (transaction > Short.MAX_VALUE) {
throw new IllegalArgumentException(transaction + " too big for a short");
}
TShortList l = this.occurrences.get(item);
if (l == null) {
throw new IllegalArgumentException("item " + item + " has no tidlist");
}
l.add((short) transaction);
}