本文整理汇总了Java中gnu.trove.iterator.TIntObjectIterator类的典型用法代码示例。如果您正苦于以下问题:Java TIntObjectIterator类的具体用法?Java TIntObjectIterator怎么用?Java TIntObjectIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TIntObjectIterator类属于gnu.trove.iterator包,在下文中一共展示了TIntObjectIterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: print
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
@Override
public void print(PrintStream os, Module m)
{
os.println("**************** Intervals ******************");
TIntObjectIterator<LiveInterval> itr = slot2LI.iterator();
while (itr.hasNext())
{
int slot = itr.key();
LiveInterval interval = itr.value();
interval.print(os, null);
TargetRegisterClass rc = getIntervalRegClass(slot);
if (rc != null)
{
os.printf("[%s]\n", rc.getName());
}
else
{
os.println("[unknown]");
}
}
}
示例2: testIteratorRemoval2
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
public void testIteratorRemoval2() {
int element_count = 10000;
int remaining = element_count / 2;
TIntObjectHashMap<String> map =
new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE );
for ( int pass = 0; pass < 10; pass++ ) {
Random r = new Random();
for ( int i = 0; i <= element_count; i++ ) {
map.put( Integer.valueOf( r.nextInt() ), String.valueOf( i ) );
}
TIntObjectIterator iterator = map.iterator();
while ( map.size() > remaining && iterator.hasNext() ) {
iterator.advance();
iterator.remove();
}
}
}
示例3: process
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
@Override
public void process(@Nonnull final EntityPlayer player) {
if (this.messages.size() == 0)
return;
// Go through the cached messages and get rid of those
// that expire.
final int currentTick = EnvironState.getTickCounter();
final TIntObjectIterator<EntityBubbleContext> entityData = this.messages.iterator();
while (entityData.hasNext()) {
entityData.advance();
final EntityBubbleContext ctx = entityData.value();
if (ctx.clean(currentTick))
entityData.remove();
}
}
示例4: writeTopKBounds
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
public void writeTopKBounds(MultipleOutputs<?, ?> sideOutputs, String outputName, String path, int minsup) throws IOException, InterruptedException {
final IntWritable itemW = new IntWritable();
final IntWritable boundW = new IntWritable();
TIntObjectIterator<PatternWithFreq[]> it = this.topK.iterator();
while (it.hasNext()) {
it.advance();
if (it.value()[this.k - 1] != null) {
final int supportCount = it.value()[this.k - 1].getSupportCount();
if (supportCount > minsup) {
itemW.set(it.key());
boundW.set(supportCount);
sideOutputs.write(outputName, itemW, boundW, path);
}
}
}
}
示例5: collectItemStats
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
/**
* @see infoMode
*/
private void collectItemStats() {
TIntObjectIterator<PatternWithFreq[]> iterator = this.topK.iterator();
while (iterator.hasNext()) {
iterator.advance();
int item = iterator.key();
PatternWithFreq[] itemTopK = iterator.value();
int nbPatterns = 0;
int supportSum = 0;
while (nbPatterns < this.k && itemTopK[nbPatterns] != null) {
supportSum += itemTopK[nbPatterns].getSupportCount();
nbPatterns++;
}
int lowestSupport = itemTopK[nbPatterns - 1].getSupportCount();
if (itemTopK[0] != null) {
this.decorated.collect(itemTopK[0].getSupportCount(), new int[] { item, nbPatterns, supportSum,
lowestSupport });
}
}
}
示例6: getFulfilledRowRequests
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
public void getFulfilledRowRequests(ArrayList<ServerRowRequest> requests) {
int clock = bgClock.getMinClock();
requests.clear();
TIntObjectMap<List<ServerRowRequest>> bgRowRequests = clockBgRowRequests
.get(clock);
if (bgRowRequests == null) {
return;
}
TIntObjectIterator<List<ServerRowRequest>> iter =
bgRowRequests.iterator();
while (iter.hasNext()) {
iter.advance();
requests.addAll(iter.value());
}
clockBgRowRequests.remove(clock);
}
示例7: tickTimeouts
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
public static void tickTimeouts()
{
if (++timer >= 200)
{
timer = 0;
int threshold = 30; // 5 minute timeout for non-accessed images
TIntObjectIterator<ImageHandler> iterator = HANDLERS.iterator();
for (int i = HANDLERS.size(); i > 0; --i)
{
iterator.advance();
ImageHandler imageHandler = iterator.value();
if (imageHandler.useSingleTemplateImage == false)
{
imageHandler.regionImageCache.removeOld(threshold);
}
}
}
}
示例8: normalizeAll
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
/** Normalizes all potentials in the tree, both node and sepset. */
public void normalizeAll()
{
int n = cpfs.length;
for (int i = 0; i < n; i++) {
if (cpfs[i] != null) {
cpfs[i].normalize();
}
}
TIntObjectIterator it = sepsets.iterator();
while (it.hasNext()) {
it.advance();
Factor ptl = ((Sepset) it.value()).ptl;
ptl.normalize();
}
}
示例9: dump
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
public void dump ()
{
int n = cpfs.length;
// This will cause OpenJGraph to print all our nodes and edges
System.out.println(dumpToString());
// Now lets print all the cpfs
System.out.println("Vertex CPFs");
for (int i = 0; i < n; i++) {
if (cpfs[i] != null) {
System.out.println("CPF "+i+" "+cpfs[i].dumpToString ());
}
}
// And the sepset potentials
System.out.println("sepset CPFs");
TIntObjectIterator it = sepsets.iterator();
while (it.hasNext()) {
it.advance();
Factor ptl = ((Sepset) it.value()).ptl;
System.out.println(ptl.dumpToString ());
}
System.out.println ("/End JT");
}
示例10: isNaN
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
public boolean isNaN()
{
int n = cpfs.length;
for (int i = 0; i < n; i++)
if (cpfs[i].isNaN()) return true;
// And the sepset potentials
TIntObjectIterator it = sepsets.iterator();
while (it.hasNext()) {
it.advance();
Factor ptl = ((Sepset) it.value()).ptl;
if (ptl.isNaN()) return true;
}
return false;
}
示例11: generateAppendInstanceCaches
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
private void generateAppendInstanceCaches() {
MxGeneratorAdapter mv = cleanableWriter.defineMethod(ACC_PUBLIC, APPEND_INSTANCE_CACHES_METHOD);
mv.visitCode();
mv.loadArg(1);
mv.checkCast(thisType);
int instance = mv.newLocal(thisType);
mv.storeLocal(instance);
for (TIntObjectIterator<Generator> it = instanceCleanMethods.iterator(); it.hasNext();) {
it.advance();
mv.loadArg(0);
mv.loadLocal(instance);
it.value().generate(mv);
mv.invokeInterface(CommonRuntimeTypes.LIST_TYPE, LIST_ADD_METHOD);
mv.pop();
}
mv.returnValue();
mv.endMethod();
}
示例12: dumpMap
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
protected void dumpMap() {
try {
tmpFileIndex++;
String outfile = tmpDIR + "/" + tmpFileIndex + ".tmp";
logger.info("dumping memory to file: " + outfile);
PrintStream tmpContentFile = new PrintStream(outfile);
TIntObjectIterator<T> it = id2item.iterator();
while (it.hasNext()) {
it.advance();
T item = it.value();
tmpContentFile.print(item.getID());
tmpContentFile.print("\t");
tmpContentFile.print(Serialization.serialize(item));
tmpContentFile.print("\n");
it.remove();
}
tmpContentFile.close();
} catch (Exception e) {
logger.error(e.toString());
}
}
开发者ID:hltfbk,项目名称:Excitement-TDMLEDA,代码行数:22,代码来源:UnlimitedMemoryBasedCountableIdentifiableStorage.java
示例13: writeSimnilarity
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
protected void writeSimnilarity(int element1Id, double element1Score, TIntObjectIterator<ElementSimilarityScoring> it, boolean bR2L) throws SerializationException, IOException, NoScoreFoundException {
TIntDoubleMap elementsScores = new TIntDoubleHashMap();
while (it.hasNext()) {
it.advance();
int element2Id = it.key();
if (elementFilter == null || elementFilter.isRelevantElementForCalculation(element2Id)) {
double element2Score = elementFeatureScoreStorage.getElementScore(element2Id);
ElementSimilarityScoring similarityScoring = it.value();
double similarityScore = bR2L ?
similarityScoring.getSimilarityScore(element2Score, element1Score) :
similarityScoring.getSimilarityScore(element1Score, element2Score);
if (similarityScore > 0)
elementsScores.put(element2Id, similarityScore);
}
}
LinkedHashMap<Integer, Double> sortedElementScores = SortUtil.sortMapByValue(elementsScores,true);
if (vectorTruncater != null)
sortedElementScores = vectorTruncater.truncate(sortedElementScores);
if (bR2L)
outR2LDevice.write(element1Id, sortedElementScores);
else
outL2RDevice.write(element1Id, sortedElementScores);
}
示例14: iteratorEntities
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
public Iterable<EntityRef> iteratorEntities(Class<? extends Component>... componentClasses) {
if (componentClasses.length == 0) {
return iteratorEntities();
}
TIntList idList = new TIntArrayList();
TIntObjectIterator<? extends Component> primeIterator = store.componentIterator(componentClasses[0]);
if (primeIterator == null) {
return NullIterator.newInstance();
}
while (primeIterator.hasNext()) {
primeIterator.advance();
int id = primeIterator.key();
boolean discard = false;
for (int i = 1; i < componentClasses.length; ++i) {
if (store.get(id, componentClasses[i]) == null) {
discard = true;
break;
}
}
if (!discard) {
idList.add(primeIterator.key());
}
}
return new EntityIterable(idList);
}
示例15: initialisationComplete
import gnu.trove.iterator.TIntObjectIterator; //导入依赖的package包/类
@Override
public boolean initialisationComplete(TIndexedCollection<DAGNode> nodes,
TIndexedCollection<DAGEdge> edges, boolean forceRebuild) {
if (taggedNodes_ == null) {
taggedNodes_ = MultiMap.createSortedSetMultiMap();
TIntObjectIterator<DAGNode> iter = nodes.iterator();
for (int i = nodes.size(); i-- > 0;) {
iter.advance();
DAGNode n = iter.value();
String[] props = n.getProperties();
for (String prop : props) {
if (prop.startsWith(TAG_PREFIX)) {
taggedNodes_.put(prop, n);
}
}
}
}
return super.initialisationComplete(nodes, edges, forceRebuild);
}