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


Java TLongList.add方法代码示例

本文整理汇总了Java中gnu.trove.list.TLongList.add方法的典型用法代码示例。如果您正苦于以下问题:Java TLongList.add方法的具体用法?Java TLongList.add怎么用?Java TLongList.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.list.TLongList的用法示例。


在下文中一共展示了TLongList.add方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toSegmentRing

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
public ChainOfNodes toSegmentRing() {
    if (this.segments.isEmpty()) {
        return new ChainOfNodes(new TLongArrayList());
    }

    int len = this.getLengthNonEmpty();

    TLongList ids = new TLongArrayList(len);

    for (int i = 0; i < this.segments.size(); i++) {
        WaySegment segment = this.segments.get(i);
        OsmWay way = segment.getWay();
        for (int k = 0; k < way.getNumberOfNodes(); k++) {
            if (k > 0 || i == 0) {
                ids.add(segment.getNodeId(k));
            }
        }
    }

    return new ChainOfNodes(ids);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:22,代码来源:ChainOfWays.java

示例2: testLongUnmodifiableEquality

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
public void testLongUnmodifiableEquality() {
	TLongList list1 = new TLongLinkedList();
	TLongList list2 = new TLongLinkedList();

	assertEquals( list1, list2 );
	assertEquals( list1, TCollections.unmodifiableList( list2 ) );
	assertEquals( TCollections.unmodifiableList( list1 ), list2 );
	assertEquals( TCollections.unmodifiableList( list1 ),
		TCollections.unmodifiableList( list2 ) );

	list1.add( 1 );
	list1.add( 2 );
	list1.add( 3 );

	list2.add( 1 );
	list2.add( 2 );
	list2.add( 3 );

	assertEquals( list1, list2 );
	assertEquals( list1, TCollections.unmodifiableList( list2 ) );
	assertEquals( TCollections.unmodifiableList( list1 ), list2 );
	assertEquals( TCollections.unmodifiableList( list1 ),
		TCollections.unmodifiableList( list2 ) );
}
 
开发者ID:leventov,项目名称:trove-over-koloboke-compile,代码行数:25,代码来源:TLinkedListTest.java

示例3: testLongUnmodifiableEquality

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
public void testLongUnmodifiableEquality() {
	TLongList list1 = new TLongArrayList();
	TLongList list2 = new TLongArrayList();

	assertEquals( list1, list2 );
	assertEquals( list1, TCollections.unmodifiableList( list2 ) );
	assertEquals( TCollections.unmodifiableList( list1 ), list2 );
	assertEquals( TCollections.unmodifiableList( list1 ),
		TCollections.unmodifiableList( list2 ) );

	list1.add( 1 );
	list1.add( 2 );
	list1.add( 3 );

	list2.add( 1 );
	list2.add( 2 );
	list2.add( 3 );

	assertEquals( list1, list2 );
	assertEquals( list1, TCollections.unmodifiableList( list2 ) );
	assertEquals( TCollections.unmodifiableList( list1 ), list2 );
	assertEquals( TCollections.unmodifiableList( list1 ),
		TCollections.unmodifiableList( list2 ) );
}
 
开发者ID:leventov,项目名称:trove-over-koloboke-compile,代码行数:25,代码来源:TArrayListTest.java

示例4: grep

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
/** {@inheritDoc} */
public TLongList grep(TLongProcedure condition) {
    TLongList ret = new TLongLinkedList();
    for (TLongLink l = head; got(l); l = l.getNext()) {
        if (condition.execute(l.getValue()))
            ret.add(l.getValue());
    }
    return ret;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TLongLinkedList.java

示例5: inverseGrep

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
/** {@inheritDoc} */
public TLongList inverseGrep(TLongProcedure condition) {
    TLongList ret = new TLongLinkedList();
    for (TLongLink l = head; got(l); l = l.getNext()) {
        if (!condition.execute(l.getValue()))
            ret.add(l.getValue());
    }
    return ret;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:10,代码来源:TLongLinkedList.java

示例6: grep

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public TLongList grep(TLongProcedure condition) {
    TLongList ret = new TLongLinkedList();
    for (TLongLink 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,代码来源:TLongLinkedList.java

示例7: inverseGrep

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public TLongList inverseGrep(TLongProcedure condition) {
    TLongList ret = new TLongLinkedList();
    for (TLongLink 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,代码来源:TLongLinkedList.java

示例8: clone

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
public static Way clone(OsmWay way) {
    List<? extends OsmTag> tags = cloneTags(way);
    OsmMetadata metadata = cloneMetadata(way);
    TLongList nodes = new TLongArrayList(way.getNumberOfNodes());
    for (int i = 0; i < way.getNumberOfNodes(); i++) {
        nodes.add(way.getNodeId(i));
    }
    return new Way(way.getId(), nodes, tags, metadata);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:10,代码来源:ImplUtil.java

示例9: nodesAsList

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
public static TLongList nodesAsList(OsmWay way) {
    TLongList ids = new TLongArrayList();
    for (int i = 0; i < way.getNumberOfNodes(); i++) {
        ids.add(way.getNodeId(i));
    }
    return ids;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:8,代码来源:OsmModelUtil.java

示例10: addOrCreate

import gnu.trove.list.TLongList; //导入方法依赖的package包/类
public void addOrCreate(String token, Long posting) {
    TLongList postingList = getOrCreatePostingList(token);
    postingList.add(posting);
}
 
开发者ID:dbasedow,项目名称:prospecter,代码行数:5,代码来源:StringIndex.java


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