本文整理汇总了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);
}
};
}
示例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();
}
}
示例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;
}
示例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());
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例13: iterator
import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/** {@inheritDoc} */
public TLongObjectIterator<V> iterator() {
return new TLongObjectHashIterator<V>( this );
}
示例14: iterator
import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
public TLongObjectIterator<V> iterator() {
return new TLongObjectHashIterator<V>( this );
}
示例15: iterator
import gnu.trove.iterator.TLongObjectIterator; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public TLongObjectIterator<V> iterator() {
return new TLongObjectHashIterator( this );
}