Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class NumericTokenStream.NumericTermAttribute

    Implementation of NumericTokenStream.INumericTermAttribute.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    @since 4.0

    Inheritance
    object
    Attribute
    NumericTokenStream.NumericTermAttribute
    Implements
    NumericTokenStream.INumericTermAttribute
    ITermToBytesRefAttribute
    IAttribute
    Inherited Members
    Attribute.ReflectAsString(bool)
    Attribute.ToString()
    Attribute.Clone()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Analysis
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class NumericTokenStream.NumericTermAttribute : Attribute, NumericTokenStream.INumericTermAttribute, ITermToBytesRefAttribute, IAttribute

    Constructors

    NumericTermAttribute()

    Creates, but does not yet initialize this attribute instance

    Declaration
    public NumericTermAttribute()
    See Also
    Init(long, int, int, int)

    Properties

    BytesRef

    Retrieve this attribute's BytesRef. The bytes are updated from the current term when the consumer calls FillBytesRef().

    Declaration
    public BytesRef BytesRef { get; }
    Property Value
    Type Description
    BytesRef

    this IAttributes internal BytesRef.

    RawValue

    Returns current token's raw value as long with all Shift applied, undefined before first token

    Declaration
    public long RawValue { get; }
    Property Value
    Type Description
    long

    Shift

    Returns current shift value, undefined before first token

    Declaration
    public int Shift { get; set; }
    Property Value
    Type Description
    int

    ValueSize

    Returns value size in bits (32 for float, int; 64 for double, long)

    Declaration
    public int ValueSize { get; }
    Property Value
    Type Description
    int

    Methods

    Clear()

    Clears the values in this Attribute and resets it to its default value. If this implementation implements more than one Attribute interface it clears all.

    Declaration
    public override void Clear()
    Overrides
    Attribute.Clear()

    CopyTo(IAttribute)

    Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the IAttributes this implementation supports.

    Declaration
    public override void CopyTo(IAttribute target)
    Parameters
    Type Name Description
    IAttribute target
    Overrides
    Attribute.CopyTo(IAttribute)

    FillBytesRef()

    Updates the bytes BytesRef to contain this term's final encoding.

    Declaration
    public void FillBytesRef()

    IncShift()

    Don't call this method!

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public int IncShift()
    Returns
    Type Description
    int

    Init(long, int, int, int)

    Don't call this method!

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public void Init(long value, int valueSize, int precisionStep, int shift)
    Parameters
    Type Name Description
    long value
    int valueSize
    int precisionStep
    int shift

    ReflectWith(IAttributeReflector)

    This method is for introspection of attributes, it should simply add the key/values this attribute holds to the given IAttributeReflector.

    The default implementation calls Reflect(Type, string, object) for all non-static fields from the implementing class, using the field name as key and the field value as value. The IAttribute class is also determined by Reflection. Please note that the default implementation can only handle single-Attribute implementations.

    Custom implementations look like this (e.g. for a combined attribute implementation):
    public void ReflectWith(IAttributeReflector reflector) 
    {
        reflector.Reflect(typeof(ICharTermAttribute), "term", GetTerm());
        reflector.Reflect(typeof(IPositionIncrementAttribute), "positionIncrement", GetPositionIncrement());
    }

    If you implement this method, make sure that for each invocation, the same set of IAttribute interfaces and keys are passed to Reflect(Type, string, object) in the same order, but possibly different values. So don't automatically exclude e.g. null properties!
    Declaration
    public override void ReflectWith(IAttributeReflector reflector)
    Parameters
    Type Name Description
    IAttributeReflector reflector
    Overrides
    Attribute.ReflectWith(IAttributeReflector)
    See Also
    ReflectAsString(bool)

    Implements

    NumericTokenStream.INumericTermAttribute
    ITermToBytesRefAttribute
    IAttribute
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.