当前位置: 首页>>代码示例>>Java>>正文


Java TShortList.add方法代码示例

本文整理汇总了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());
}
 
开发者ID:groupon,项目名称:monsoon,代码行数:27,代码来源:ToXdr.java

示例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;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TShortLinkedList.java

示例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;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TShortLinkedList.java

示例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;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:11,代码来源:TShortLinkedList.java

示例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;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:11,代码来源:TShortLinkedList.java

示例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);
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:12,代码来源:ShortMapTidList.java


注:本文中的gnu.trove.list.TShortList.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。