Examples of charsNeededForFullPath()


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

  @Override
  public final boolean incrementToken() throws IOException {
    if (input.incrementToken()) {
      if (categoryAttribute != null && categoryAttribute.getCategoryPath() != null) {
        CategoryPath categoryPath = categoryAttribute.getCategoryPath();
        char[] termBuffer = termAttribute.resizeBuffer(categoryPath.charsNeededForFullPath());
        int nChars = indexingParams.drillDownTermText(categoryPath, termBuffer);
        termAttribute.setLength(nChars);
        setPayload();
      }
      return true;
View Full Code Here

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

 
  @Test
  public void testCharsNeededForFullPath() {
    String[] components = { "hello", "world", "yo" };
    CategoryPath p = new CategoryPath();
    assertEquals(0, p.charsNeededForFullPath());
    int expectedCharsNeeded = 0;
    for (int i=0; i<components.length; i++) {
      p.add(components[i]);
      expectedCharsNeeded += components[i].length();
      if (i>0) {
View Full Code Here

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

      p.add(components[i]);
      expectedCharsNeeded += components[i].length();
      if (i>0) {
        expectedCharsNeeded++;
      }
      assertEquals(expectedCharsNeeded, p.charsNeededForFullPath());
    }
  }
 
  @Test
  public void testCopyToCharArray() {
View Full Code Here

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

 
  @Test
  public void testCopyToCharArray() {
    String[] components = { "hello", "world", "yo" };
    CategoryPath p = new CategoryPath(components);
    char[] charArray = new char[p.charsNeededForFullPath()];
    int numCharsCopied = 0;
   
    numCharsCopied = p.copyToCharArray(charArray, 0, 0, '.');
    assertEquals(0, numCharsCopied);
    assertEquals("", new String(charArray, 0, numCharsCopied));
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.