Enhanced C#
Language of your choice: library documentation
Public fields | Public Member Functions | List of all members
Loyc.Collections.Impl.SetWrapper< T, TSet > Class Template Reference

A simple base class that helps you use the decorator pattern on a set. By default, all it does is forward every method to the underlying collection (including GetHashCode, Equals and ToString). You can change its behavior by overriding methods. More...


Source file:
Inheritance diagram for Loyc.Collections.Impl.SetWrapper< T, TSet >:
Loyc.WrapperBase< TSet >

Remarks

A simple base class that helps you use the decorator pattern on a set. By default, all it does is forward every method to the underlying collection (including GetHashCode, Equals and ToString). You can change its behavior by overriding methods.

This could be used, for example, to help you implement a collection that needs to take some kind of action whenever the collection is modified.

See also
CollectionWithChangeEvents<T, TColl>
Type Constraints
TSet :ISet<T> 

Public fields

virtual int Count => _obj.Count
 
virtual bool IsReadOnly => _obj.IsReadOnly
 

Public Member Functions

 SetWrapper (TSet wrappedObject)
 
virtual bool Add (T item)
 
virtual void Clear ()
 
virtual bool Remove (T item)
 
virtual void ExceptWith (IEnumerable< T > other)
 
virtual void IntersectWith (IEnumerable< T > other)
 
virtual void SymmetricExceptWith (IEnumerable< T > other)
 
virtual void UnionWith (IEnumerable< T > other)
 
virtual bool IsProperSubsetOf (IEnumerable< T > other)
 
virtual bool IsProperSupersetOf (IEnumerable< T > other)
 
virtual bool IsSubsetOf (IEnumerable< T > other)
 
virtual bool IsSupersetOf (IEnumerable< T > other)
 
virtual bool Overlaps (IEnumerable< T > other)
 
virtual bool SetEquals (IEnumerable< T > other)
 
virtual bool Contains (T item)
 
virtual void CopyTo (T[] array, int arrayIndex)
 
virtual IEnumerator< T > GetEnumerator ()
 
- Public Member Functions inherited from Loyc.WrapperBase< TSet >
override bool Equals (object obj)
 Returns true iff the parameter 'obj' is a wrapper around the same object that this object wraps. More...
 
override int GetHashCode ()
 Returns the hashcode of the wrapped object. More...
 
override string ToString ()
 Returns ToString() of the wrapped object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Loyc.WrapperBase< TSet >
 WrapperBase (T wrappedObject)
 
- Protected fields inherited from Loyc.WrapperBase< TSet >
_obj
 
- Protected static fields inherited from Loyc.WrapperBase< TSet >
static readonly EqualityComparer< T > TComp