org.elasticsearch.index.mapper.xcontent
Class NumberFieldMapper.CachedNumericTokenStream

java.lang.Object
  extended by org.apache.lucene.util.AttributeSource
      extended by org.apache.lucene.analysis.TokenStream
          extended by org.elasticsearch.index.mapper.xcontent.NumberFieldMapper.CachedNumericTokenStream
All Implemented Interfaces:
java.io.Closeable
Enclosing class:
NumberFieldMapper<T extends java.lang.Number>

protected static final class NumberFieldMapper.CachedNumericTokenStream
extends org.apache.lucene.analysis.TokenStream

A wrapper around a numeric stream allowing to reuse it by implementing the end method which returns this stream back to the thread local cache.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
org.apache.lucene.util.AttributeSource.AttributeFactory, org.apache.lucene.util.AttributeSource.State
 
Constructor Summary
NumberFieldMapper.CachedNumericTokenStream(org.apache.lucene.analysis.NumericTokenStream numericTokenStream, int precisionStep)
           
 
Method Summary
 void close()
          Close the input TokenStream.
 void end()
           
 boolean incrementToken()
           
 void reset()
          Reset the filter as well as the input TokenStream.
 NumberFieldMapper.CachedNumericTokenStream setDoubleValue(double value)
           
 NumberFieldMapper.CachedNumericTokenStream setFloatValue(float value)
           
 NumberFieldMapper.CachedNumericTokenStream setIntValue(int value)
           
 NumberFieldMapper.CachedNumericTokenStream setLongValue(long value)
           
 
Methods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, restoreState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumberFieldMapper.CachedNumericTokenStream

public NumberFieldMapper.CachedNumericTokenStream(org.apache.lucene.analysis.NumericTokenStream numericTokenStream,
                                                  int precisionStep)
Method Detail

end

public void end()
         throws java.io.IOException
Overrides:
end in class org.apache.lucene.analysis.TokenStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close the input TokenStream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class org.apache.lucene.analysis.TokenStream
Throws:
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Reset the filter as well as the input TokenStream.

Overrides:
reset in class org.apache.lucene.analysis.TokenStream
Throws:
java.io.IOException

incrementToken

public boolean incrementToken()
                       throws java.io.IOException
Specified by:
incrementToken in class org.apache.lucene.analysis.TokenStream
Throws:
java.io.IOException

setIntValue

public NumberFieldMapper.CachedNumericTokenStream setIntValue(int value)

setLongValue

public NumberFieldMapper.CachedNumericTokenStream setLongValue(long value)

setFloatValue

public NumberFieldMapper.CachedNumericTokenStream setFloatValue(float value)

setDoubleValue

public NumberFieldMapper.CachedNumericTokenStream setDoubleValue(double value)