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


Java UnmodifiableIterator.next方法代码示例

本文整理汇总了Java中com.google.common.collect.UnmodifiableIterator.next方法的典型用法代码示例。如果您正苦于以下问题:Java UnmodifiableIterator.next方法的具体用法?Java UnmodifiableIterator.next怎么用?Java UnmodifiableIterator.next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.collect.UnmodifiableIterator的用法示例。


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

示例1: addListener

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
@Override
public synchronized void addListener ( final EventListener eventListener )
{
    this.listeners.add ( eventListener );

    final UnmodifiableIterator<List<Event>> it = Iterators.partition ( AbstractEventQueryImpl.this.events.iterator (), chunkSize );
    while ( it.hasNext () )
    {
        final List<org.eclipse.scada.ae.Event> chunk = it.next ();
        this.executor.execute ( new Runnable () {

            @Override
            public void run ()
            {
                eventListener.handleEvent ( chunk );
            }
        } );
    }

}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:AbstractEventQueryImpl.java

示例2: writeBlockState

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
/**
 * Writes the given blockstate to the given tag.
 *  
 * @param tag The tag to write to
 * @param state The blockstate to be written
 */
public static NBTTagCompound writeBlockState(NBTTagCompound tag, IBlockState state)
{
    tag.setString("Name", ((ResourceLocation)Block.REGISTRY.getNameForObject(state.getBlock())).toString());

    if (!state.getProperties().isEmpty())
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        UnmodifiableIterator unmodifiableiterator = state.getProperties().entrySet().iterator();

        while (unmodifiableiterator.hasNext())
        {
            Entry < IProperty<?>, Comparable<? >> entry = (Entry)unmodifiableiterator.next();
            IProperty<?> iproperty = (IProperty)entry.getKey();
            nbttagcompound.setString(iproperty.getName(), getName(iproperty, (Comparable)entry.getValue()));
        }

        tag.setTag("Properties", nbttagcompound);
    }

    return tag;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:NBTUtil.java

示例3: hasInstantEffect

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
public boolean hasInstantEffect()
{
    if (!this.effects.isEmpty())
    {
        UnmodifiableIterator unmodifiableiterator = this.effects.iterator();

        while (unmodifiableiterator.hasNext())
        {
            PotionEffect potioneffect = (PotionEffect)unmodifiableiterator.next();

            if (potioneffect.getPotion().isInstant())
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:PotionType.java

示例4: apply

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
@Override
public Optional<TRSRTransformation> apply(final Optional<? extends IModelPart> part)
{
    if (part.isPresent())
    {
        final UnmodifiableIterator<String> parts = Models.getParts(part.get());
        if (parts.hasNext())
        {
            final String name = parts.next();
            if (!parts.hasNext() && this.blacklist && this.parts.contains(name)
                    || !this.blacklist && !this.parts.contains(name))
                return this.value;
        }
    }
    return Optional.empty();
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:17,代码来源:VisibilityModelState.java

示例5: apply

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
@Override
public Optional<TRSRTransformation> apply(Optional<? extends IModelPart> part)
      {
          if(part.isPresent())
          {
              // This whole thing is subject to change, but should do for now.
              UnmodifiableIterator<String> parts = Models.getParts(part.get());
              if(parts.hasNext())
              {
                  String name = parts.next();
                  // only interested in the root level
                  if(!parts.hasNext() && hidden.contains(name))
                  {
                      return value;
                  }
              }
          }
          return Optional.absent();
      }
 
开发者ID:Bitterholz,项目名称:LP2,代码行数:20,代码来源:BlockGenericPipe.java

示例6: getHighestFiveCardHand

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
@Override
    public IHand getHighestFiveCardHand()
    {
//        if(cards.size() < 5)
//        {
//            return this;
//        }
//        return new Hand(cards.asList().reverse().subList(0,5));

        UnmodifiableIterator iter = cards.iterator();
        int offset = cards.size() - 5;
        while(offset-- > 0)
        {
            iter.next();
        }
        return new SortedHand(cards.tailSet((Card)iter.next()) );
    }
 
开发者ID:williamrubens,项目名称:mossypokerbot,代码行数:18,代码来源:SortedHand.java

示例7: getHighestFiveCardHand

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
@Override
public IHand getHighestFiveCardHand() {
    if(cards.size() < 5)
    {
        return this;
    }

    ImmutableSortedSet<Card> sortedCards = cardsSorted();
    UnmodifiableIterator iter = sortedCards.iterator();
    int offset = sortedCards.size() - 5;
    while(offset-- > 0)
    {
        iter.next();
    }
    return new SortedHand(sortedCards.tailSet((Card)iter.next()) );
}
 
开发者ID:williamrubens,项目名称:mossypokerbot,代码行数:17,代码来源:UnsortedHand.java

示例8: testReplacingValueInThirdRange

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
@Test
public void testReplacingValueInThirdRange() {
    final ImmutableCollection<Range> existingRanges = makeSomeRanges();

    final long intendedNumBytesToTransfer = numBytesToTransfer(existingRanges, existingRanges.size());
    final long numBytesTransferred = 27000;

    final ImmutableCollection<Range> newRanges = RangeHelper.replaceRange(existingRanges, numBytesTransferred, intendedNumBytesToTransfer);

    assertEquals(1, newRanges.size());

    final UnmodifiableIterator<Range> existingRangesIterator = existingRanges.iterator();
    existingRangesIterator.next();

    final long lengthOf2ndRange = existingRangesIterator.next().getLength();
    final long expectedStartIn3rdRange = lengthOf2ndRange + numBytesTransferred;

    assertEquals(expectedStartIn3rdRange, newRanges.iterator().next().getStart());
    assertEquals(existingRangesIterator.next().getEnd(), newRanges.iterator().next().getEnd());
}
 
开发者ID:SpectraLogic,项目名称:ds3_java_sdk,代码行数:21,代码来源:RangeHelperImpl_Test.java

示例9: testReplacingValueWhenWeTransferExactlyFirstRange

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
@Test
public void testReplacingValueWhenWeTransferExactlyFirstRange() {
    final ImmutableCollection<Range> existingRanges = makeSomeRanges();

    final long intendedNumBytesToTransfer = numBytesToTransfer(existingRanges, existingRanges.size());
    final long numBytesTransferred = existingRanges.iterator().next().getLength();

    final ImmutableCollection<Range> newRanges = RangeHelper.replaceRange(existingRanges, numBytesTransferred, intendedNumBytesToTransfer);

    assertEquals(2, newRanges.size());

    final UnmodifiableIterator<Range> existingRangesIterator = existingRanges.iterator();
    existingRangesIterator.next();

    final UnmodifiableIterator<Range> newRangesIterator = newRanges.iterator();

    while (existingRangesIterator.hasNext()) {
        final Range existingRange = existingRangesIterator.next();
        final Range newRange = newRangesIterator.next();

        assertEquals(existingRange.getStart(), newRange.getStart());
        assertEquals(existingRange.getLength(), newRange.getLength());
    }
}
 
开发者ID:SpectraLogic,项目名称:ds3_java_sdk,代码行数:25,代码来源:RangeHelperImpl_Test.java

示例10: testReplacingValueWhenWeTransferExactly1st2Ranges

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
@Test
public void testReplacingValueWhenWeTransferExactly1st2Ranges() {
    final ImmutableCollection<Range> existingRanges = makeSomeRanges();

    final long intendedNumBytesToTransfer = numBytesToTransfer(existingRanges, existingRanges.size());
    final long numBytesTransferred = numBytesToTransfer(existingRanges, 2);

    final ImmutableCollection<Range> newRanges = RangeHelper.replaceRange(existingRanges, numBytesTransferred, intendedNumBytesToTransfer);

    assertEquals(1, newRanges.size());

    final UnmodifiableIterator<Range> existingRangesIterator = existingRanges.iterator();
    existingRangesIterator.next();
    existingRangesIterator.next();

    final UnmodifiableIterator<Range> newRangesIterator = newRanges.iterator();

    while (existingRangesIterator.hasNext()) {
        final Range existingRange = existingRangesIterator.next();
        final Range newRange = newRangesIterator.next();

        assertEquals(existingRange.getStart(), newRange.getStart());
        assertEquals(existingRange.getLength(), newRange.getLength());
    }
}
 
开发者ID:SpectraLogic,项目名称:ds3_java_sdk,代码行数:26,代码来源:RangeHelperImpl_Test.java

示例11: testReplacingValueWhenWeTransfer0Bytes

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
@Test
public void testReplacingValueWhenWeTransfer0Bytes() {
    final ImmutableCollection<Range> existingRanges = makeSomeRanges();

    final long intendedNumBytesToTransfer = numBytesToTransfer(existingRanges, existingRanges.size());
    final long numBytesTransferred = 0;

    final ImmutableCollection<Range> newRanges = RangeHelper.replaceRange(existingRanges, numBytesTransferred, intendedNumBytesToTransfer);

    assertEquals(3, newRanges.size());

    final UnmodifiableIterator<Range> existingRangesIterator = existingRanges.iterator();

    final UnmodifiableIterator<Range> newRangesIterator = newRanges.iterator();

    while (existingRangesIterator.hasNext()) {
        final Range existingRange = existingRangesIterator.next();
        final Range newRange = newRangesIterator.next();

        assertEquals(existingRange.getStart(), newRange.getStart());
        assertEquals(existingRange.getLength(), newRange.getLength());
    }
}
 
开发者ID:SpectraLogic,项目名称:ds3_java_sdk,代码行数:24,代码来源:RangeHelperImpl_Test.java

示例12: compareTo

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
public int compareTo(@Nonnull RelMultipleTrait o) {
  final RelCollationImpl that = (RelCollationImpl) o;
  final UnmodifiableIterator<RelFieldCollation> iterator =
      that.fieldCollations.iterator();
  for (RelFieldCollation f : fieldCollations) {
    if (!iterator.hasNext()) {
      return 1;
    }
    final RelFieldCollation f2 = iterator.next();
    int c = Utilities.compare(f.getFieldIndex(), f2.getFieldIndex());
    if (c != 0) {
      return c;
    }
  }
  return iterator.hasNext() ? -1 : 0;
}
 
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:RelCollationImpl.java

示例13: tableNames

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
public Collection<String> tableNames() {
    // TODO: once we support closing/opening tables change this to concreteIndices()
    // and add  state info to the TableInfo.

    Set<String> tables = new HashSet<>();
    tables.addAll(Collections2.filter(Collections2.transform(
            Arrays.asList(clusterService.state().metaData().concreteAllOpenIndices()), indexToTableName), tablesFilter));

    // Search for partitioned table templates
    UnmodifiableIterator<String> templates = clusterService.state().metaData().getTemplates().keysIt();
    while (templates.hasNext()) {
        String templateName = templates.next();
        if (!PartitionName.isPartition(templateName)) {
            continue;
        }
        try {
            PartitionName partitionName = PartitionName.fromIndexOrTemplate(templateName);
            TableIdent ti = partitionName.tableIdent();
            if (schemaName.equalsIgnoreCase(ti.schema())) {
                tables.add(ti.name());
            }
        } catch (IllegalArgumentException e) {
            // do nothing
        }
    }

    return tables;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:29,代码来源:DocSchemaInfo.java

示例14: register

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
private static void register(int typeid, String minecraftKey, final Block block) {
	Block.REGISTRY.a(typeid, new MinecraftKey(minecraftKey), block);
	UnmodifiableIterator<IBlockData> iterable = block.t().a().iterator();
	while (iterable.hasNext()) {
		IBlockData iblockdata = iterable.next();
		int k = Block.REGISTRY.a(block) << 4 | block.toLegacyData(iblockdata);
		Block.REGISTRY_ID.a(iblockdata, k);

	}
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:11,代码来源:PandaWireInjector.java

示例15: register

import com.google.common.collect.UnmodifiableIterator; //导入方法依赖的package包/类
private static void register(int typeid, String minecraftKey, final Block block) {
	Block.REGISTRY.a(typeid, new MinecraftKey(minecraftKey), block);
	UnmodifiableIterator<IBlockData> iterable = block.s().a().iterator();
	while (iterable.hasNext()) {
		IBlockData iblockdata = iterable.next();
		int k = Block.REGISTRY.a(block) << 4 | block.toLegacyData(iblockdata);
		Block.REGISTRY_ID.a(iblockdata, k);

	}
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:11,代码来源:PandaWireInjector.java


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