本文整理汇总了Java中gnu.trove.list.TShortList.iterator方法的典型用法代码示例。如果您正苦于以下问题:Java TShortList.iterator方法的具体用法?Java TShortList.iterator怎么用?Java TShortList.iterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.list.TShortList
的用法示例。
在下文中一共展示了TShortList.iterator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
};
}
}
示例2: 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);
}
}
示例3: getIterable
import gnu.trove.list.TShortList; //导入方法依赖的package包/类
@Override
public TIntIterable getIterable(int item) {
final TShortList l = this.occurrences.get(item);
if (l == null) {
throw new IllegalArgumentException("item " + item + " has no tidlist");
} else {
return new TIntIterable() {
@Override
public TIntIterator iterator() {
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();
}
};
}
};
}
}