|
using System;
using System.Collections.Generic;
using System.Text;
namespace Loyc.Collections
{
/// <summary>Represents a write-only collection: you can modify it, but you
/// cannot learn what it contains.</summary>
#if CSharp4
public interface ISinkCollection<in T>
#else
public interface ISinkCollection<T>
#endif
{
void Add(T item);
void Clear();
bool Remove(T item);
}
/// <summary>Represents a write-only array.</summary>
#if CSharp4
public interface ISinkArray<in T>
#else
public interface ISinkArray<T> : ICount
#endif
{
T this[int index] { set; }
}
/// <summary>Represents a write-only indexable list class.</summary>
#if CSharp4
public interface ISinkList<in T> : ISinkCollection<T>, ISinkArray<T>
#else
public interface ISinkList<T> : ISinkCollection<T>, ISinkArray<T>
#endif
{
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.