Examples of capacityComponents()


Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

 
  @Test
  public void testConstructorCapacity() {
    CategoryPath p = new CategoryPath(0,0);
    assertEquals(0, p.capacityChars());
    assertEquals(0, p.capacityComponents());
    assertEquals(0, p.length());
    p = new CategoryPath(5,18);
    assertEquals(5, p.capacityChars());
    assertEquals(18, p.capacityComponents());
    assertEquals(0, p.length());
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

    assertEquals(0, p.capacityChars());
    assertEquals(0, p.capacityComponents());
    assertEquals(0, p.length());
    p = new CategoryPath(5,18);
    assertEquals(5, p.capacityChars());
    assertEquals(18, p.capacityComponents());
    assertEquals(0, p.length());
    p = new CategoryPath(27,13);
    assertEquals(27, p.capacityChars());
    assertEquals(13, p.capacityComponents());
    assertEquals(0, p.length());
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

    assertEquals(5, p.capacityChars());
    assertEquals(18, p.capacityComponents());
    assertEquals(0, p.length());
    p = new CategoryPath(27,13);
    assertEquals(27, p.capacityChars());
    assertEquals(13, p.capacityComponents());
    assertEquals(0, p.length());
  }
 
  @Test
  public void testClear() {
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

    // works correctly. Also check that it allocates exactly the needed
    // needed size for the array - not more.
    CategoryPath p = new CategoryPath("", '/');
    assertEquals(p.length(), 0);
    assertEquals(p.capacityChars(), 0);
    assertEquals(p.capacityComponents(), 0);
    p = new CategoryPath("hello", '/');
    assertEquals(p.length(), 1);
    assertEquals(p.capacityChars(), 5);
    assertEquals(p.capacityComponents(), 1);
    assertEquals(p.toString('@'), "hello");
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

    assertEquals(p.capacityChars(), 0);
    assertEquals(p.capacityComponents(), 0);
    p = new CategoryPath("hello", '/');
    assertEquals(p.length(), 1);
    assertEquals(p.capacityChars(), 5);
    assertEquals(p.capacityComponents(), 1);
    assertEquals(p.toString('@'), "hello");
    p = new CategoryPath("hi/there", '/');
    assertEquals(p.length(), 2);
    assertEquals(p.capacityChars(), 7);
    assertEquals(p.capacityComponents(), 2);
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

    assertEquals(p.capacityComponents(), 1);
    assertEquals(p.toString('@'), "hello");
    p = new CategoryPath("hi/there", '/');
    assertEquals(p.length(), 2);
    assertEquals(p.capacityChars(), 7);
    assertEquals(p.capacityComponents(), 2);
    assertEquals(p.toString('@'), "hi@there");
    p = new CategoryPath("how/are/you/doing?", '/');
    assertEquals(p.length(), 4);
    assertEquals(p.capacityChars(), 15);
    assertEquals(p.capacityComponents(), 4);
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

    assertEquals(p.capacityComponents(), 2);
    assertEquals(p.toString('@'), "hi@there");
    p = new CategoryPath("how/are/you/doing?", '/');
    assertEquals(p.length(), 4);
    assertEquals(p.capacityChars(), 15);
    assertEquals(p.capacityComponents(), 4);
    assertEquals(p.toString('@'), "how@are@you@doing?");
  }
 
  @Test
  public void testDefaultConstructor() {
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

    // defaults to creating an object with a 0 initial capacity.
    // If we change this default later, we also need to change this
    // test.
    CategoryPath p = new CategoryPath();
    assertEquals(0, p.capacityChars());
    assertEquals(0, p.capacityComponents());
    assertEquals(0, p.length());
    assertEquals("", p.toString('/'));
  }
 
  @Test
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

      assertEquals(p.length(), clone.length());
      assertEquals(p.toString('/'), clone.toString('/'));
      // verify that the newly created clone has exactly the right
      // capacity, with no spare (while the original path p probably
      // does have spare)
      assertEquals(i, clone.capacityComponents());
      assertEquals(expectedchars, clone.capacityChars());
      // Finally, add another component to the path, for the next
      // round of this loop
      String num = Integer.toString(i);
      p.add(num);
View Full Code Here

Examples of org.apache.lucene.facet.taxonomy.CategoryPath.capacityComponents()

   
    CategoryPath p1 = new CategoryPath(p,2);
    assertEquals(2, p1.length());
    assertEquals("hi/there", p1.toString('/'));
    // the new prefix object should only take the space it needs:
    assertEquals(2, p1.capacityComponents());
    assertEquals(7, p1.capacityChars());

    p1 = new CategoryPath(p,1);
    assertEquals(1, p1.length());
    assertEquals("hi", p1.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.