test_class.file: oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/fv/TruncateTokenFilterTest.java
test_class.identifier: TruncateTokenFilterTest
test_case.body: @Test
      public void testFiltering() throws Exception {
          TokenStream stream = new WhitespaceTokenizer(Version.LUCENE_47, new StringReader("0.10 0.20 0.30 0.40"));
          TruncateTokenFilter filter = new TruncateTokenFilter(stream, 3);
          filter.reset();
          List<String> expectedTokens = new LinkedList<>();
          expectedTokens.add("0.1");
          expectedTokens.add("0.2");
          expectedTokens.add("0.3");
          expectedTokens.add("0.4");
          int i = 0;
          while (filter.incrementToken()) {
              CharTermAttribute charTermAttribute = filter.getAttribute(CharTermAttribute.class);
              String token = new String(charTermAttribute.buffer(), 0, charTermAttribute.length());
              assertEquals(expectedTokens.get(i), token);
              i++;
          }
          filter.close();
      }
test_case.class_method_signature: TruncateTokenFilterTest.testFiltering()
test_case.full_signature: @Test public void testFiltering()
test_case.identifier: testFiltering
test_case.invocations: reset add add add add incrementToken getAttribute buffer length assertEquals get close
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFiltering()
focal_class.declarator: termAttribute = addAttribute(CharTermAttribute.class)
focal_class.modifier: private final
focal_class.original_string: private final CharTermAttribute termAttribute = addAttribute(CharTermAttribute.class);
focal_class.type: CharTermAttribute
focal_class.var_name: termAttribute
focal_class.declarator: keywordAttr = addAttribute(KeywordAttribute.class)
focal_class.modifier: private final
focal_class.original_string: private final KeywordAttribute keywordAttr = addAttribute(KeywordAttribute.class);
focal_class.type: KeywordAttribute
focal_class.var_name: keywordAttr
focal_class.declarator: length
focal_class.modifier: private final
focal_class.original_string: private final int length;
focal_class.type: int
focal_class.var_name: length
focal_class.file: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/util/fv/TruncateTokenFilter.java
focal_class.identifier: TruncateTokenFilter
focal_class.class_method_signature: TruncateTokenFilter.TruncateTokenFilter(TokenStream input, int length)
focal_class.full_signature:   TruncateTokenFilter(TokenStream input, int length)
focal_class.identifier: TruncateTokenFilter
focal_class.parameters: (TokenStream input, int length)
focal_class.signature:  TruncateTokenFilter(TokenStream input, int length)
focal_class.class_method_signature: TruncateTokenFilter.incrementToken()
focal_class.full_signature: @Override public final boolean incrementToken()
focal_class.identifier: incrementToken
focal_class.modifiers: @Override public final
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean incrementToken()
focal_class.superclass: extends TokenFilter
focal_method.body: @Override
      public final boolean incrementToken() throws IOException {
        if (input.incrementToken()) {
          if (!keywordAttr.isKeyword() && termAttribute.length() > length) {
            termAttribute.setLength(length);
          }
          return true;
        } else {
          return false;
        }
      }
focal_method.class_method_signature: TruncateTokenFilter.incrementToken()
focal_method.full_signature: @Override public final boolean incrementToken()
focal_method.identifier: incrementToken
focal_method.invocations: incrementToken isKeyword length setLength
focal_method.modifiers: @Override public final
focal_method.parameters: ()
focal_method.return: boolean
focal_method.signature: boolean incrementToken()