本文整理汇总了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);
}
示例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 ) );
}
示例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 ) );
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例10: addOrCreate
import gnu.trove.list.TLongList; //导入方法依赖的package包/类
public void addOrCreate(String token, Long posting) {
TLongList postingList = getOrCreatePostingList(token);
postingList.add(posting);
}