Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ScriptAttribute

    Implementation of IScriptAttribute that stores the script as an integer.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    Attribute
    ScriptAttribute
    Implements
    IScriptAttribute
    IAttribute
    Inherited Members
    Attribute.ReflectAsString(bool)
    Attribute.ToString()
    Attribute.Clone()
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Analysis.Icu.TokenAttributes
    Assembly: Lucene.Net.ICU.dll
    Syntax
    public class ScriptAttribute : Attribute, IScriptAttribute, IAttribute

    Constructors

    ScriptAttribute()

    Initializes this attribute with ICU4N.Globalization.UScript.Common.

    Declaration
    public ScriptAttribute()

    Properties

    Code

    Gets or Sets the numeric code for this script value.

    This is the constant value from ICU4N.Globalization.UScript.
    Declaration
    public virtual int Code { get; set; }
    Property Value
    Type Description
    int

    Methods

    Clear()

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

    Declaration
    public override void Clear()
    Overrides
    Lucene.Net.Util.Attribute.Clear()

    CopyTo(IAttribute)

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

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

    Equals(object)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    object other
    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    object.Equals(object)

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    object.GetHashCode()

    GetName()

    Get the full name.

    Declaration
    public virtual string GetName()
    Returns
    Type Description
    string

    UTR #24 full name.

    GetShortName()

    Get the abbreviated name.

    Declaration
    public virtual string GetShortName()
    Returns
    Type Description
    string

    UTR #24 abbreviated name.

    ReflectWith(IAttributeReflector)

    This method is for introspection of attributes, it should simply add the key/values this attribute holds to the given Lucene.Net.Util.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 Lucene.Net.Util.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 Lucene.Net.Util.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
    Lucene.Net.Util.Attribute.ReflectWith(Lucene.Net.Util.IAttributeReflector)
    See Also
    ReflectAsString(bool)

    Implements

    IScriptAttribute
    Lucene.Net.Util.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.