Examples of moveToNext()


Examples of org.apache.uima.cas.FSIterator.moveToNext()

      ok = true;
    }
    assertTrue(ok);
    ok = false;
    try {
      it.moveToNext(); // should throw
    } catch (ConcurrentModificationException e) {
      ok = true;
    }
    assertTrue(ok);
    it.moveTo(a);
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToNext()

      if (b != null) {
  assertTrue(bagIndex.compare(b, a) <= 0);
      }
      b = a;
      v.add(a.hashCode());
      it.moveToNext();
    }
    assertTrue(bagIndex.size() == v.size());

    // Check that reverse iterator produces reverse sequence.
    it.moveToLast();
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToNext()

    it = bagIndex.iterator();
    it.moveToFirst(); // This is redundant.
    current = 1;
    // System.out.println("Codes: " + v);
    while (current < (v.size() - 1)) {
      it.moveToNext();
      assertTrue(it.isValid());
      assertTrue(it.get().hashCode() == v.get(current));
      it.moveToNext();
      assertTrue(it.isValid());
      assertTrue(it.get().hashCode() == v.get(current + 1));
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToNext()

    // System.out.println("Codes: " + v);
    while (current < (v.size() - 1)) {
      it.moveToNext();
      assertTrue(it.isValid());
      assertTrue(it.get().hashCode() == v.get(current));
      it.moveToNext();
      assertTrue(it.isValid());
      assertTrue(it.get().hashCode() == v.get(current + 1));
      it.moveToPrevious();
      assertTrue(it.isValid());
      assertTrue(it.get().hashCode() == v.get(current));
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToNext()

    // Test iterator copy.
    FSIterator source, copy;
    source = this.cas.getAnnotationIndex().iterator();
    // Count items.
    int count = 0;
    for (source.moveToFirst(); source.isValid(); source.moveToNext()) {
      ++count;
    }

    final int max = count;
    count = 0;
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToNext()

//       System.out.println("Count: " + count);
      assertTrue(source.isValid());
      assertTrue(copy.isValid());
      String out = source.get().toString() + copy.get().toString();
      assertTrue(out, source.get().equals(copy.get()));
      source.moveToNext();
      copy.moveToNext();
      ++count;
    }

    // /////////////////////////////////////////////////////////////////////////
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToNext()

      while (iter.isValid()) {
        if (iter.get().getType() == subtypeHandle) // expected
          break;
        if (iter.get().getType() == supertypeHandle) // unexpected
          fail();
        iter.moveToNext();
      }

      // test that passing an invalid object causes an error
      descList.add(new ConfigurationParameter_impl());
      try {
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToNext()

    while (iterator.isValid()) {
      SofaFS sofa = (SofaFS) iterator.get();
      if (sofaName.equals(getStringValue(((FeatureStructureImpl)sofa).getAddress(), this.svd.casMetadata.ts.sofaIdFeatCode))) {
        return sofa;
      }
      iterator.moveToNext();
    }
    CASRuntimeException e = new CASRuntimeException(CASRuntimeException.SOFANAME_NOT_FOUND,
        new String[] { sofaName });
    throw e;
  }
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToNext()

      // next line the getView as a side effect
      //   checks for dupl sofa name, and if not,
      //   adds the name to the sofaNameSet
      ((CASImpl) this.getView(sofa)).registerView(sofa);
 
      iterator.moveToNext();
    }
    this.svd.viewCount = numViews;  // total number of views
    for (int viewNbr = 1; viewNbr <= numViews; viewNbr++) {
      CAS view = (viewNbr == 1) ? getInitialView() : getView(viewNbr);
      if (view != null) {
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToNext()

    // Remove any existing document annotations.
    FSIterator it = getAnnotationIndex(ts.docType).iterator();
    ArrayList list = new ArrayList();
    while (it.isValid()) {
      list.add(it.get());
      it.moveToNext();
    }
    for (int i = 0; i < list.size(); i++) {
      getIndexRepository().removeFS((FeatureStructure) list.get(i));
    }
    // Create a new document annotation.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.