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


Java TLongObjectIterator类代码示例

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


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

示例1: iterator

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
@Override
public Iterator<NextTickListEntry> iterator() {
    return new Iterator<NextTickListEntry>() {
        private final TLongObjectIterator<BlockUpdateEntry> iterator = trackerMap.iterator();;

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

        @Override
        public NextTickListEntry next() {
            iterator.advance();
            return iterator.value().asMCEntry();
        }

        @Override
        public void remove() {
            removeEntry(iterator.value(), true);
        }
    };
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:23,代码来源:BlockUpdatesTracker.java

示例2: process

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
@Override
public void process(@Nonnull final EntityPlayer player) {

	if (this.systems.size() == 0)
		return;

	final double range = ModOptions.specialEffectRange;
	final BlockPos min = EnvironState.getPlayerPosition().add(-range, -range, -range);
	final BlockPos max = EnvironState.getPlayerPosition().add(range, range, range);

	final TLongObjectIterator<ParticleSystem> itr = this.systems.iterator();
	while (itr.hasNext()) {
		itr.advance();

		// If it is out of range expire, else update
		if (!BlockPosHelper.contains(itr.value().getPos(), min, max)) {
			itr.value().setExpired();
		} else {
			itr.value().onUpdate();
		}

		// If it's dead remove from the list
		if (!itr.value().isAlive())
			itr.remove();
	}
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:27,代码来源:ParticleSystemHandler.java

示例3: serialize

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
@Override
public JsonElement serialize( final FragmentSegmentAssignment src, final Type typeOfSrc, final JsonSerializationContext context )
{
	final Gson gson = new Gson();

	final JsonObject jsonILut = new JsonObject();
	final TLongObjectIterator< long[] > ilutIterator = src.ilut.iterator();
	while ( ilutIterator.hasNext() )
	{
		ilutIterator.advance();
		jsonILut.add(
				Long.toString( ilutIterator.key() ),
				gson.toJsonTree( ilutIterator.value() ) );
	}

	final JsonObject jsonObject = new JsonObject();
	jsonObject.add( "ilut", jsonILut );

	return jsonObject;
}
 
开发者ID:saalfeldlab,项目名称:bigcat,代码行数:21,代码来源:FragmentSegmentAssignment.java

示例4: fallCheck

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/**
 * Make any unsupported blocks fall that are disturbed for the current tick
 */
private void fallCheck() {
    this.visitsWorstTick = Math.max(this.visitsWorstTick, this.visitsThisTick);
    this.visitsThisTick = 0;

    World world = this.getMatch().getWorld();
    TLongObjectMap<ParticipantState> blockDisturbers = this.blockDisturbersByTick.remove(this.getMatch().getClock().now().tick);
    if(blockDisturbers == null) return;

    TLongSet supported = new TLongHashSet();
    TLongSet unsupported = new TLongHashSet();
    TLongObjectMap<ParticipantState> fallsByBreaker = new TLongObjectHashMap<>();

    try {
        while(!blockDisturbers.isEmpty()) {
            long pos = blockDisturbers.keySet().iterator().next();
            ParticipantState breaker = blockDisturbers.remove(pos);

            // Search down for the first block that can actually fall
            for(;;) {
                long below = neighborPos(pos, BlockFace.DOWN);
                if(!Materials.isColliding(blockAt(world, below).getType())) break;
                blockDisturbers.remove(pos); // Remove all the blocks we find along the way
                pos = below;
            }

            // Check if the block needs to fall, if it isn't already falling
            if(!fallsByBreaker.containsKey(pos) && !this.isSupported(pos, supported, unsupported)) {
                fallsByBreaker.put(pos, breaker);
            }
        }
    } catch(MaxSearchVisitsExceeded ex) {
        this.logError(ex);
    }

    for(TLongObjectIterator<ParticipantState> iter = fallsByBreaker.iterator(); iter.hasNext();) {
        iter.advance();
        this.fall(iter.key(), iter.value());
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:43,代码来源:FallingBlocksMatchModule.java

示例5: equals

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/** {@inheritDoc} */
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongObjectMap ) ) {
        return false;
    }
    TLongObjectMap that = ( TLongObjectMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TLongObjectIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            long key = iter.key();
            Object value = iter.value();
            if ( value == null ) {
                if ( !( that.get( key ) == null && that.containsKey( key ) ) ) {
                    return false;
                }
            } else {
                if ( !value.equals( that.get( key ) ) ) {
                    return false;
                }
            }
        }
    } catch ( ClassCastException ex ) {
        // unused.
    }
    return true;
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:31,代码来源:TLongObjectHashMap.java

示例6: equals

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongObjectMap ) ) {
        return false;
    }
    TLongObjectMap that = ( TLongObjectMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TLongObjectIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            long key = iter.key();
            Object value = iter.value();
            if ( value == null ) {
                if ( !( that.get( key ) == null && that.containsKey( key ) ) ) {
                    return false;
                }
            } else {
                if ( !value.equals( that.get( key ) ) ) {
                    return false;
                }
            }
        }
    } catch ( ClassCastException ex ) {
        // unused.
    }
    return true;
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:30,代码来源:TLongObjectHashMap.java

示例7: equals

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@SuppressWarnings("rawtypes")
public boolean equals( Object other ) {
    if ( ! ( other instanceof TLongObjectMap ) ) {
        return false;
    }
    TLongObjectMap that = ( TLongObjectMap ) other;
    if ( that.size() != this.size() ) {
        return false;
    }
    try {
        TLongObjectIterator iter = this.iterator();
        while ( iter.hasNext() ) {
            iter.advance();
            long key = iter.key();
            Object value = iter.value();
            if ( value == null ) {
                if ( !( that.get( key ) == null && that.containsKey( key ) ) ) {
                    return false;
                }
            } else {
                if ( !value.equals( that.get( key ) ) ) {
                    return false;
                }
            }
        }
    } catch ( ClassCastException ex ) {
        // unused.
    }
    return true;
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:33,代码来源:TLongObjectHashMap.java

示例8: resize

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
public SparseMatrixT<T> resize(int[] dim){
	SparseMatrixT<T> mat = new SparseMatrixT<T>(dim);
	TLongObjectIterator<T> it = vector.iterator();
	while(it.hasNext()){
		it.advance();
		long key = it.key();
		T val = it.value();
		int[] idx = getIndices(key);
		mat.set(idx, val);
	}
	return mat;
}
 
开发者ID:FudanNLP,项目名称:fnlp,代码行数:13,代码来源:SparseMatrixT.java

示例9: resize

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
public SparseMatrix<T> resize(int dim){
	SparseMatrix<T> mat = new SparseMatrix<T>(dim);
	TLongObjectIterator<T> it = vector.iterator();
	while(it.hasNext()){
		it.advance();
		long key = it.key();
		T val = it.value();
		int[] idx = getIndices(key);
		mat.set(idx[0],idx[1], val);
	}
	return mat;
}
 
开发者ID:FudanNLP,项目名称:fnlp,代码行数:13,代码来源:SparseMatrix.java

示例10: createInterpreter

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/**
 * Creates a new formula interpreter for the parameter values in this table.
 */
public FormulaInterpreter createInterpreter() {
	FormulaInterpreter interpreter = new FormulaInterpreter();
	TLongObjectIterator<Map<String, ParameterCell>> it = entries.iterator();
	while (it.hasNext()) {
		it.advance();
		Map<String, ParameterCell> map = it.value();
		for (ParameterCell cell : map.values())
			cell.bindTo(interpreter);
	}
	return interpreter;
}
 
开发者ID:GreenDelta,项目名称:olca-modules,代码行数:15,代码来源:ParameterTable.java

示例11: simulate

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/**
 * Calculates new random values for the parameters in this table that have
 * an uncertainty distribution assigned. The method creates a formula
 * interpreter that is used for the evaluation of the uncertainty parameters
 * and returned with the new values bound. Thus, the returned interpreter
 * can be used in calculations.
 */
public FormulaInterpreter simulate() {
	FormulaInterpreter interpreter = createInterpreter();
	TLongObjectIterator<Map<String, ParameterCell>> it = entries.iterator();
	while (it.hasNext()) {
		it.advance();
		Map<String, ParameterCell> map = it.value();
		for (ParameterCell cell : map.values()) {
			cell.eval(interpreter);
			cell.simulate();
			cell.bindTo(interpreter);
		}
	}
	return interpreter;
}
 
开发者ID:GreenDelta,项目名称:olca-modules,代码行数:22,代码来源:ParameterTable.java

示例12: getProviderFlows

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/** Get all product or waste treatment providers from the database. */
public List<LongPair> getProviderFlows() {
	List<LongPair> list = new ArrayList<>();
	TLongObjectIterator<TLongArrayList> it = providerMap.iterator();
	while (it.hasNext()) {
		it.advance();
		long productId = it.key();
		for (long processId : it.value().toArray()) {
			list.add(LongPair.of(processId, productId));
		}
	}
	return list;
}
 
开发者ID:GreenDelta,项目名称:olca-modules,代码行数:14,代码来源:ProcessTable.java

示例13: iterator

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/** {@inheritDoc} */
public TLongObjectIterator<V> iterator() {
    return new TLongObjectHashIterator<V>( this );
}
 
开发者ID:JianpingZeng,项目名称:xcc,代码行数:5,代码来源:TLongObjectHashMap.java

示例14: iterator

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
public TLongObjectIterator<V> iterator() {
    return new TLongObjectHashIterator<V>( this );
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:4,代码来源:TLongObjectHashMap.java

示例15: iterator

import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public TLongObjectIterator<V> iterator() {
    return new TLongObjectHashIterator( this );
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:6,代码来源:TLongObjectHashMap.java


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