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


Java ListIterator.next方法代码示例

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


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

示例1: termArraysEquals

import java.util.ListIterator; //导入方法依赖的package包/类
private boolean termArraysEquals(List<Term[]> termArrays1, List<Term[]> termArrays2) {
    if (termArrays1.size() != termArrays2.size()) {
        return false;
    }
    ListIterator<Term[]> iterator1 = termArrays1.listIterator();
    ListIterator<Term[]> iterator2 = termArrays2.listIterator();
    while (iterator1.hasNext()) {
        Term[] termArray1 = iterator1.next();
        Term[] termArray2 = iterator2.next();
        if (!(termArray1 == null ? termArray2 == null : Arrays.equals(termArray1,
                termArray2))) {
            return false;
        }
    }
    return true;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:MultiPhrasePrefixQuery.java

示例2: start

import java.util.ListIterator; //导入方法依赖的package包/类
/** Starts the NetSystem Engine and executes the simulation.
 * This method should be called when <b>all</b> NetNode of <b>all</b>
 * QueueNetworks are ready to start.
 * @throws Exception
 */
public static void start() throws Exception {
	NetNode Node;
	ListIterator<QueueNetwork> nets = networkList.listIterator();
	ListIterator<NetNode> nodes;
	QueueNetwork Network;
	startTime = System.currentTimeMillis();

	while (nets.hasNext()) {
		Network = nets.next();
		if (Network.getState() == QueueNetwork.STATE_READY) {
			nodes = Network.getNodes().listIterator();
			while (nodes.hasNext()) {
				Node = nodes.next();
				Node.send(NetEvent.EVENT_START, null, 0.0, NodeSection.NO_ADDRESS, NodeSection.INPUT, Node);
				Node.send(NetEvent.EVENT_START, null, 0.0, NodeSection.NO_ADDRESS, NodeSection.SERVICE, Node);
				Node.send(NetEvent.EVENT_START, null, 0.0, NodeSection.NO_ADDRESS, NodeSection.OUTPUT, Node);
			}
			Network.setState(QueueNetwork.STATE_RUNNING);
		}
	}

	netController.start();
	netController.run();
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:30,代码来源:NetSystem.java

示例3: processValidRangeStatement

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 * Checks valid range statement as sub-statement of leaf statement.
 */
@Test
public void processValidRangeStatement() throws IOException, ParserException {

    YangNode node = manager.getDataModel("src/test/resources/ValidRangeStatement.yang");

    assertThat((node instanceof YangModule), is(true));
    assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));
    YangModule yangNode = (YangModule) node;
    assertThat(yangNode.getName(), is("Test"));

    ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
    YangLeaf leafInfo = leafIterator.next();

    assertThat(leafInfo.getName(), is("invalid-interval"));
    assertThat(leafInfo.getDataType().getDataTypeName(), is("int32"));
    assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.INT32));
    YangRangeRestriction rangeRestriction = (YangRangeRestriction) leafInfo
            .getDataType().getDataTypeExtendedInfo();

    ListIterator<YangRangeInterval> rangeListIterator = rangeRestriction.getAscendingRangeIntervals()
            .listIterator();
    YangRangeInterval rangeInterval = rangeListIterator.next();
    assertThat(((YangInt32) rangeInterval.getStartValue()).getValue(), is(1));
    assertThat(((YangInt32) rangeInterval.getEndValue()).getValue(), is(4));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:29,代码来源:RangeRestrictionListenerTest.java

示例4: processLeafListSubStatementType

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 * Checks type for leaf-list.
 */
@Test
public void processLeafListSubStatementType() throws IOException, ParserException {

    YangNode node = manager.getDataModel("src/test/resources/LeafListSubStatementType.yang");

    // Check whether the data model tree returned is of type module.
    assertThat((node instanceof YangModule), is(true));

    // Check whether the node type is set properly to module.
    assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));

    // Check whether the module name is set correctly.
    YangModule yangNode = (YangModule) node;
    assertThat(yangNode.getName(), is("Test"));

    ListIterator<YangLeafList> leafListIterator = yangNode.getListOfLeafList().listIterator();
    YangLeafList leafListInfo = leafListIterator.next();

    assertThat(leafListInfo.getName(), is("invalid-interval"));
    assertThat(leafListInfo.getDataType().getDataTypeName(), is("uint16"));
    assertThat(leafListInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:TypeListenerTest.java

示例5: processUnitsDefaultValue

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 * Checks the default value of unit statement.
 */
@Test
public void processUnitsDefaultValue() throws IOException, ParserException {

    YangNode node = manager.getDataModel("src/test/resources/UnitsDefaultValue.yang");

    // Check whether the data model tree returned is of type module.
    assertThat(node instanceof YangModule, is(true));

    // Check whether the node type is set properly to module.
    assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));

    // Check whether the module name is set correctly.
    YangModule yangNode = (YangModule) node;
    assertThat(yangNode.getName(), is("Test"));

    ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
    YangLeaf leafInfo = leafIterator.next();

    assertThat(leafInfo.getName(), is("invalid-interval"));
    assertThat(leafInfo.getUnits(), is(nullValue()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:UnitsListenerTest.java

示例6: removeAnimatedEventFromView

import java.util.ListIterator; //导入方法依赖的package包/类
public void removeAnimatedEventFromView(int viewTag, String eventName, int animatedValueTag) {
  String key = viewTag + eventName;
  if (mEventDrivers.containsKey(key)) {
    List<EventAnimationDriver> driversForKey = mEventDrivers.get(key);
    if (driversForKey.size() == 1) {
      mEventDrivers.remove(viewTag + eventName);
    } else {
      ListIterator<EventAnimationDriver> it = driversForKey.listIterator();
      while (it.hasNext()) {
        if (it.next().mValueNode.mTag == animatedValueTag) {
          it.remove();
          break;
        }
      }
    }
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:18,代码来源:NativeAnimatedNodesManager.java

示例7: processDerivedTypeStatement

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 * Checks derived statement without contraints.
 */
@Test
public void processDerivedTypeStatement() throws IOException, ParserException {

    YangNode node = manager.getDataModel("src/test/resources/DerivedTypeStatement.yang");

    // Check whether the data model tree returned is of type module.
    assertThat((node instanceof YangModule), is(true));

    // Check whether the node type is set properly to module.
    assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));

    // Check whether the module name is set correctly.
    YangModule yangNode = (YangModule) node;
    assertThat(yangNode.getName(), is("Test"));

    ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
    YangLeaf leafInfo = leafIterator.next();

    assertThat(leafInfo.getName(), is("invalid-interval"));
    assertThat(leafInfo.getDataType().getDataTypeName(), is("hello"));
    assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.DERIVED));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:TypeListenerTest.java

示例8: principalsToString

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 * convert the Principals portion of this policy entry into a string
 */
String principalsToString() {
    String result = "";
    if ((grantEntry.principals != null) &&
        (!grantEntry.principals.isEmpty())) {
        StringBuffer buffer = new StringBuffer(200);
        ListIterator<PolicyParser.PrincipalEntry> list =
                            grantEntry.principals.listIterator();
        while (list.hasNext()) {
            PolicyParser.PrincipalEntry pppe = list.next();
            buffer.append(" Principal " + pppe.getDisplayClass() + " " +
                pppe.getDisplayName(true));
            if (list.hasNext()) buffer.append(", ");
        }
        result = buffer.toString();
    }
    return result;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:PolicyTool.java

示例9: processMandatoryFalse

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 * Checks valid mandatory with value false statement.
 */
@Test
public void processMandatoryFalse() throws IOException, ParserException {

    YangNode node = manager.getDataModel("src/test/resources/MandatoryFalse.yang");

    // Check whether the data model tree returned is of type module.
    assertThat((node instanceof YangModule), is(true));

    // Check whether the node type is set properly to module.
    assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));

    // Check whether the module name is set correctly.
    YangModule yangNode = (YangModule) node;
    assertThat(yangNode.getName(), is("Test"));

    ListIterator<YangLeaf> leafIterator = yangNode.getListOfLeaf().listIterator();
    YangLeaf leafInfo = leafIterator.next();

    // Check whether the mandatory value is set correctly.
    assertThat(leafInfo.getName(), is("invalid-interval"));
    assertThat(leafInfo.isMandatory(), is(false));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:MandatoryListenerTest.java

示例10: processListSubStatements

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 * Checks list with all its sub-statements.
 */
@Test
public void processListSubStatements() throws IOException, ParserException {

    YangNode node = manager.getDataModel("src/test/resources/ListSubStatements.yang");

    assertThat((node instanceof YangModule), is(true));

    // Check whether the node type is set properly to module.
    assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));

    // Check whether the module name is set correctly.
    YangModule yangNode = (YangModule) node;
    assertThat(yangNode.getName(), is("Test"));

    // Check whether the list is child of module
    YangList yangList = (YangList) yangNode.getChild();

    // Check whether list properties as set correctly.
    assertThat(yangList.getName(), is("ospf"));
    assertThat(yangList.getKeyList().contains("invalid-interval"), is(true));

    assertThat(yangList.isConfig(), is(true));
    assertThat(yangList.getMaxElements(), is(10));
    assertThat(yangList.getMinElements(), is(3));
    assertThat(yangList.getDescription(), is("\"list description\""));
    assertThat(yangList.getStatus(), is(YangStatusType.CURRENT));
    assertThat(yangList.getReference(), is("\"list reference\""));

    // Check whether leaf properties as set correctly.
    ListIterator<YangLeaf> leafIterator = yangList.getListOfLeaf().listIterator();
    YangLeaf leafInfo = leafIterator.next();

    assertThat(leafInfo.getName(), is("invalid-interval"));
    assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
    assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
    assertThat(leafInfo.getUnits(), is("\"seconds\""));
    assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
    assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:43,代码来源:ListListenerTest.java

示例11: _getDisclosedItemId

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 *  Returns first disclosed child's Id.
 *
 * @param context the facesContext object
 * @param component
 * @return String id of the first showDetailItem child that can be rendered
 *                and is disclosed
 * @throws IOException
 */
@SuppressWarnings("unchecked")
private static String _getDisclosedItemId(FacesContext context,
                                          UIComponent component)
  throws IOException
{
  String returnId = null;
  ListIterator<UIComponent> iter = component.getChildren().listIterator();

  if (iter == null)
  {
    return null;
  }

  // This will only render UIXShowDetail children.
  // other children are ignored.
  while ( iter.hasNext())
  {
    UIComponent child = iter.next();
    if (! child.isRendered() )
    {
      continue;
    }

    // only CoreShowDetailItem children are rendered. Rest are ignored.
    if ( (child instanceof UIXShowDetail))
    {
      UIXShowDetail detailChild = (UIXShowDetail) child;
      if (detailChild.isDisclosed())
      {
        returnId = detailChild.getClientId(context);
        break;
      }
    }
  }
  return returnId;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:46,代码来源:ShowOneListRendererBase.java

示例12: _scanQueue

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 * Run through the queue to see if we got a possible match of:
 * [0] stx, [1 - (n-1)] Integers within time frame, [n]
 * @return the count of key events we can dump out to the user
 */
private int _scanQueue()
{
    StringBuilder barcode = new StringBuilder();
    ListIterator<KeyEvent> iter = queue.listIterator();

    KeyEvent first = iter.next();
    if ((first.getID() != KeyEvent.KEY_TYPED) || (first.getKeyChar() != config.stx))
        return 1;
    
    while (iter.hasNext())
    {
        KeyEvent ke = iter.next();            
        if (ke.getID() != KeyEvent.KEY_TYPED)  // only look at TYPED events
            continue;

        Character c = ke.getKeyChar();
        if (c == config.stx) // a second stx char, clear buffer before this 
            return iter.nextIndex()-1;
        
        if (c == config.etx) {
            queue.clear();
            log.log(Level.FINE, "Scanned barcode {0}", barcode);
            Messenger.sendEvent(MT.BARCODE_SCANNED, barcode.toString());
            return iter.nextIndex();  // time to dump
        }

        barcode.append(c);            
        if (barcode.length() > 20) {
            log.log(Level.FINE, "Barcode too long, ignoring");
            return iter.nextIndex(); // time to dump
        }
    }

    return 0;
}
 
开发者ID:drytoastman,项目名称:scorekeeperfrontend,代码行数:41,代码来源:BarcodeScannerWatcher.java

示例13: testModListIteratorNext

import java.util.ListIterator; //导入方法依赖的package包/类
@Test(dataProvider = "modifiable",
      expectedExceptions = ConcurrentModificationException.class)
public void testModListIteratorNext(List<Integer> list, int from, int to) {
    List<Integer> subList = list.subList(from, to);
    ListIterator<Integer> it = subList.listIterator();
    list.add(42);
    it.next();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:SubList.java

示例14: processContainerSubStatements

import java.util.ListIterator; //导入方法依赖的package包/类
/**
 * Checks container with all its sub-statements.
 */
@Test
public void processContainerSubStatements() throws IOException, ParserException {

    YangNode node = manager.getDataModel("src/test/resources/ContainerSubStatements.yang");

    assertThat((node instanceof YangModule), is(true));

    // Check whether the node type is set properly to module.
    assertThat(node.getNodeType(), is(YangNodeType.MODULE_NODE));

    // Check whether the module name is set correctly.
    YangModule yangNode = (YangModule) node;
    assertThat(yangNode.getName(), is("Test"));

    // Check whether the container is child of module
    YangContainer yangContainer = (YangContainer) yangNode.getChild();

    // Check whether container properties as set correctly.
    assertThat(yangContainer.getName(), is("ospf"));

    assertThat(yangContainer.isConfig(), is(true));
    assertThat(yangContainer.getPresence(), is("\"ospf logs\""));
    assertThat(yangContainer.getDescription(), is("\"container description\""));
    assertThat(yangContainer.getStatus(), is(YangStatusType.CURRENT));
    assertThat(yangContainer.getReference(), is("\"container reference\""));

    // Check whether leaf properties as set correctly.
    ListIterator<YangLeaf> leafIterator = yangContainer.getListOfLeaf().listIterator();
    YangLeaf leafInfo = leafIterator.next();

    assertThat(leafInfo.getName(), is("invalid-interval"));
    assertThat(leafInfo.getDataType().getDataTypeName(), is("uint16"));
    assertThat(leafInfo.getDataType().getDataType(), is(YangDataTypes.UINT16));
    assertThat(leafInfo.getUnits(), is("\"seconds\""));
    assertThat(leafInfo.getStatus(), is(YangStatusType.CURRENT));
    assertThat(leafInfo.getReference(), is("\"RFC 6020\""));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:41,代码来源:ContainerListenerTest.java

示例15: drawSparks

import java.util.ListIterator; //导入方法依赖的package包/类
public final void drawSparks()
{
	final ListIterator<Sparks> iterator = SparkList.listIterator();

	while (iterator.hasNext())
	{
		final Sparks spark = iterator.next();

		if (spark.Active == true)
		{
			spark.Render();
		}
	}
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:15,代码来源:SparksList.java


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