Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class Counter

    Simple counter class

    Note

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

    Note

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

    Inheritance
    object
    Counter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class Counter

    Properties

    Value

    Gets the counters current value.

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

    Methods

    AddAndGet(long)

    Adds the given delta to the counters current value.

    Declaration
    public abstract long AddAndGet(long delta)
    Parameters
    Type Name Description
    long delta

    The delta to add.

    Returns
    Type Description
    long

    The counters updated value.

    Get()

    Returns the counters current value.

    Declaration
    [Obsolete("Use Value instead. This method will be removed in 4.8.0 release candidate.")]
    public virtual long Get()
    Returns
    Type Description
    long

    The counters current value.

    NewCounter()

    Returns a new counter. The returned counter is not thread-safe.

    Declaration
    public static Counter NewCounter()
    Returns
    Type Description
    Counter

    NewCounter(bool)

    Returns a new counter.

    Declaration
    public static Counter NewCounter(bool threadSafe)
    Parameters
    Type Name Description
    bool threadSafe

    true if the returned counter can be used by multiple threads concurrently.

    Returns
    Type Description
    Counter

    A new counter.

    Operators

    implicit operator long(Counter)

    Returns this counter's Value implicitly.

    Declaration
    public static implicit operator long(Counter counter)
    Parameters
    Type Name Description
    Counter counter
    Returns
    Type Description
    long
    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.