Was this page helpful?

ExpiringHashSet<T> Class

    Table of Contents
    public class ExpiringHashSet<T>
    Namespace: MindTouch.Collections
    Assembly: mindtouch.dream
    Type Hierarchy:
    • object
      • ExpiringHashSet<T>
    Implements:
    • IEnumerable<Entry<T>>
    • IEnumerable
    • IDisposable
    Represents a set of values with an expiration time.

    Remarks

    Values inserted into this this set will expire after some set time (which may be updated and reset), automatically removing the value from the set and firing a notification event E:MindTouch.Collections.ExpiringHashSet`1.EntryExpired. The set may optionally be configured to extend a value's expiration on access, including accessing the entry via the instances iterator.

    Generic Parameters

    Parameter T

    The type of elements in the list.
    Constraints:
    none

    Members

    Constructors

    Visibility Description
    Public ExpiringHashSet(TaskTimerFactory taskTimerFactory) Create a new hashset
    Public ExpiringHashSet(TaskTimerFactory taskTimerFactory, bool autoRefresh) Create a new hashset

    Properties

    Visibility Description
    Public this[T value] Get the MindTouch.Collections.ExpiringHashSet<T>.Entry meta-data container for the given value.

    Methods

    Visibility Description
    Public SetExpiration(T value, TimeSpan ttl) Add or update the expiration for an item
    Public SetExpiration(T value, DateTime when) Add or update the expiration for an item
    Public RemoveExpiration(T value) Obsolete: The method ExpiringHashSet<T>.RemoveExpiration(T value) has been deprecated. Use ExpiringHashSet<T>.Delete(T value) instead.
    Public Delete(T value) Remove a value from the set.
    Public RefreshExpiration(T value) Extend an entry's expiration by its time-to-live.
    Public Dispose() Dispose the set, releasing all entries.
    Public ToString() (Inherited from Object)
    Public Equals(object obj) (Inherited from Object)
    Public GetHashCode() (Inherited from Object)
    Public GetType() (Inherited from Object)
    Protected MemberwiseClone() (Inherited from Object)

    Events

    Visibility Description
    Public EntryExpired Fired for every entry that expires.
    Public CollectionChanged Fired any time a value is added, removed or experiation is changed.
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by