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

Java TShortList类代码示例

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

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



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

示例1: subList

import gnu.trove.list.TShortList; //导入依赖的package包/类
/** {@inheritDoc} */
  public TShortList subList( int begin, int end ) {
  	if ( end < begin ) {
	throw new IllegalArgumentException( "end index " + end +
		" greater than begin index " + begin );
}
if ( begin < 0 ) {
	throw new IndexOutOfBoundsException( "begin index can not be < 0" );
}
if ( end > _data.length ) {
	throw new IndexOutOfBoundsException( "end index < " + _data.length );
}
      TShortArrayList list = new TShortArrayList( end - begin );
      for ( int i = begin; i < end; i++ ) {
      	list.add( _data[ i ] );
      }
      return list;
  }
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:19,代码来源:TShortArrayList.java


示例2: subList

import gnu.trove.list.TShortList; //导入依赖的package包/类
/** {@inheritDoc} */
public TShortList subList(int begin, int end) {
    if (end < begin) {
        throw new IllegalArgumentException("begin index " + begin +
                " greater than end index " + end);
    }
    if (size < begin) {
        throw new IllegalArgumentException("begin index " + begin +
                " greater than last index " + size);
    }
    if (begin < 0) {
        throw new IndexOutOfBoundsException("begin index can not be < 0");
    }
    if (end > size) {
        throw new IndexOutOfBoundsException("end index < " + size);
    }

    TShortLinkedList ret = new TShortLinkedList();
    TShortLink tmp = getLinkAt(begin);
    for (int i = begin; i < end; i++) {
        ret.add(tmp.getValue()); // copy
        tmp = tmp.getNext();
    }

    return ret;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:27,代码来源:TShortLinkedList.java


示例3: equals

import gnu.trove.list.TShortList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean equals( Object other ) {
    if ( other == this ) {
        return true;
    }
    if ( !( other instanceof TShortList ) ) return false;

    TShortList that = ( TShortList )other;
    if ( size() != that.size() ) return false;

    for( int i = 0; i < size(); i++ ) {
        if ( get( i ) != that.get( i ) ) {
            return false;
        }
    }
    return true;
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:19,代码来源:TShortLinkedList.java


示例4: subList

import gnu.trove.list.TShortList; //导入依赖的package包/类
/** {@inheritDoc} */
  @Override
  public TShortList subList( int begin, int end ) {
  	if ( end < begin ) {
	throw new IllegalArgumentException( "end index " + end +
		" greater than begin index " + begin );
}
if ( begin < 0 ) {
	throw new IndexOutOfBoundsException( "begin index can not be < 0" );
}
if ( end > _data.length ) {
	throw new IndexOutOfBoundsException( "end index < " + _data.length );
}
      TShortArrayList list = new TShortArrayList( end - begin );
      for ( int i = begin; i < end; i++ ) {
      	list.add( _data[ i ] );
      }
      return list;
  }
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:20,代码来源:TShortArrayList.java


示例5: 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


示例6: get

import gnu.trove.list.TShortList; //导入依赖的package包/类
@Override
public TIntIterator get(final int item) {
	final TShortList l = this.occurrences.get(item);
	if (l == null) {
		throw new IllegalArgumentException("item " + item + " has no tidlist");
	} else {
		final TShortIterator iter = l.iterator();
		return new TIntIterator() {

			@Override
			public void remove() {
				throw new UnsupportedOperationException();
			}

			@Override
			public boolean hasNext() {
				return iter.hasNext();
			}

			@Override
			public int next() {
				return iter.next();
			}
		};
	}
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:27,代码来源:ShortMapTidList.java


示例7: set

import gnu.trove.list.TShortList; //导入依赖的package包/类
public void set(final TShortList value) {
    final Command command = new Command(Command.SETALL, (short) value.size());
    commands.add(command);
    ++baselineCommandCount;

    //Is this the best way to do this?
    v.clear();
    v.addAll(value);

    for (int i = 0, size = value.size(); i < size; ++i) {
        final Command subCommand = new Command(Command.SET, (short) i, value.get(i));
        commands.add(subCommand);
        ++baselineCommandCount;
    }

    touch();
    onChanged();
}
 
开发者ID:bacta,项目名称:pre-cu,代码行数:19,代码来源:AutoDeltaShortVector.java


示例8: grep

import gnu.trove.list.TShortList; //导入依赖的package包/类
/** {@inheritDoc} */
public TShortList grep( TShortProcedure condition ) {
    TShortArrayList list = new TShortArrayList();
    for ( int i = 0; i < _pos; i++ ) {
        if ( condition.execute( _data[ i ] ) ) {
            list.add( _data[ i ] );
        }
    }
    return list;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TShortArrayList.java


示例9: inverseGrep

import gnu.trove.list.TShortList; //导入依赖的package包/类
/** {@inheritDoc} */
public TShortList inverseGrep( TShortProcedure condition ) {
    TShortArrayList list = new TShortArrayList();
    for ( int i = 0; i < _pos; i++ ) {
        if ( !condition.execute( _data[ i ] ) ) {
            list.add( _data[ i ] );
        }
    }
    return list;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:11,代码来源:TShortArrayList.java


示例10: TShortLinkedList

import gnu.trove.list.TShortList; //导入依赖的package包/类
public TShortLinkedList(TShortList list) {
    no_entry_value = list.getNoEntryValue();
    //
    for (TShortIterator iterator = list.iterator(); iterator.hasNext();) {
        short next = iterator.next();
        add(next);
    }
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:9,代码来源:TShortLinkedList.java


示例11: sort

import gnu.trove.list.TShortList; //导入依赖的package包/类
/** {@inheritDoc} */
public void sort(int fromIndex, int toIndex) {
    TShortList tmp = subList(fromIndex, toIndex);
    short[] vals = tmp.toArray();
    Arrays.sort(vals);
    set(fromIndex, vals);
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:8,代码来源:TShortLinkedList.java


示例12: 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


示例13: 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


示例14: readExternal

import gnu.trove.list.TShortList; //导入依赖的package包/类
public void readExternal( ObjectInput in )
    throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // LIST
    list = ( TShortList ) in.readObject();
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TShortListDecorator.java


示例15: grep

import gnu.trove.list.TShortList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public TShortList grep( TShortProcedure condition ) {
    TShortArrayList list = new TShortArrayList();
    for ( int i = 0; i < _pos; i++ ) {
        if ( condition.execute( _data[ i ] ) ) {
            list.add( _data[ i ] );
        }
    }
    return list;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:12,代码来源:TShortArrayList.java


示例16: inverseGrep

import gnu.trove.list.TShortList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public TShortList inverseGrep( TShortProcedure condition ) {
    TShortArrayList list = new TShortArrayList();
    for ( int i = 0; i < _pos; i++ ) {
        if ( !condition.execute( _data[ i ] ) ) {
            list.add( _data[ i ] );
        }
    }
    return list;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:12,代码来源:TShortArrayList.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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