Package org.apache.lucene.facet.index.streaming

Examples of org.apache.lucene.facet.index.streaming.CategoryAttributesStream.incrementToken()


  public void testCategoryAttributesStream() throws IOException {
    CategoryAttributesStream stream = new CategoryAttributesStream(
        categoryContainer);
    // count the number of tokens
    int nTokens;
    for (nTokens = 0; stream.incrementToken(); nTokens++) {
    }
    assertEquals("Wrong number of tokens", 3, nTokens);
  }

  /**
 
View Full Code Here


    // test number of tokens
    CategoryAttributesStream stream = new CategoryAttributesStream(
        attributesList);
    int nTokens = 0;
    while (stream.incrementToken()) {
      nTokens++;
    }
    assertEquals("Wrong number of tokens", 3, nTokens);

    // test reset
View Full Code Here

    assertEquals("Wrong number of tokens", 3, nTokens);

    // test reset
    stream.reset();
    nTokens = 0;
    while (stream.incrementToken()) {
      nTokens++;
    }
    assertEquals("Wrong number of tokens", 3, nTokens);

    // test reset and contents
View Full Code Here

    Set<CategoryPath> pathsSet = new HashSet<CategoryPath>();
    for (int i = 0; i < initialCatgeories.length; i++) {
      pathsSet.add(initialCatgeories[i]);
    }
    stream.reset();
    while (stream.incrementToken()) {
      CategoryAttribute fromStream = stream
          .getAttribute(CategoryAttribute.class);
      if (!pathsSet.remove(fromStream.getCategoryPath())) {
        fail("Unexpected category path: "
            + fromStream.getCategoryPath().toString(':'));
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.