Returns the next token in the stream, or null at EOS. When possible, the
input Token should be used as the returned Token (this gives fastest
tokenization performance), but this is not required and a new Token may be
returned. Callers may re-use a single Token instance for successive calls
to this method.
This implicitly defines a "contract" between consumers (callers of this
method) and producers (implementations of this method that are the source
for tokens):
- A consumer must fully consume the previously returned {@link Token}
before calling this method again.
- A producer must call {@link Token#Clear()} before setting the fields in
it and returning it
Also, the producer must make no assumptions about a {@link Token} after it
has been returned: the caller may arbitrarily change it. If the producer
needs to hold onto the {@link Token} for subsequent calls, it must clone()
it before storing it. Note that a {@link TokenFilter} is considered a
consumer.
Namespace: Lucene.Net.AnalysisAssembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1
Syntax
C# |
---|
[ObsoleteAttribute("The new IncrementToken() and AttributeSource APIs should be used instead.")]
public virtual Token Next(
Token reusableToken
) |
Visual Basic |
---|
<ObsoleteAttribute("The new IncrementToken() and AttributeSource APIs should be used instead.")> _
Public Overridable Function Next ( _
reusableToken As Token _
) As Token |
Visual C++ |
---|
[ObsoleteAttribute(L"The new IncrementToken() and AttributeSource APIs should be used instead.")]
public:
virtual Token^ Next(
Token^ reusableToken
) |
Parameters
- reusableToken
- Type: Lucene.Net.Analysis..::..Token
a {@link Token} that may or may not be used to return;
this parameter should never be null (the callee is not required to
check for null before using it, but it is a good idea to assert that
it is not null.)
Return Value
next {@link Token} in the stream or null if end-of-stream was hit
See Also