Class DividendCollection
- Namespace
- Balsam
- Assembly
- Balsam.Backtester.dll
Encapsulates a collection of dividends.
public class DividendCollection : ICollection<Dividend>, IEnumerable<Dividend>, IEnumerable
- Inheritance
-
DividendCollection
- Implements
- Inherited Members
- Extension Methods
Constructors
DividendCollection()
Initializes a new empty DividendCollection.
public DividendCollection()
DividendCollection(IEnumerable<Dividend>)
Initializes a new DividendCollection using the specified dividends.
public DividendCollection(IEnumerable<Dividend> dividends)
Parameters
dividends
IEnumerable<Dividend>
Properties
Count
Gets the number of dividends in the collection.
public int Count { get; }
Property Value
FirstDate
Gets the date of the first available dividend in the collection.
public DateTime FirstDate { get; }
Property Value
IsReadOnly
Returns false.
protected bool IsReadOnly { get; }
Property Value
this[int]
Gets a dividend based on the specified index.
public Dividend this[int index] { get; }
Parameters
index
int
Property Value
LastDate
Gets the date of the last available dividend in the collection.
public DateTime LastDate { get; }
Property Value
Methods
Add(Dividend)
Adds the specified dividend to the collection.
public void Add(Dividend dividend)
Parameters
dividend
Dividend
Add(IEnumerable<Dividend>)
Adds an enumerable of dividends to the end of the collection.
public void Add(IEnumerable<Dividend> dividends)
Parameters
dividends
IEnumerable<Dividend>
Clear()
Removes all items from the collection.
public void Clear()
Contains(Dividend)
Returns true if the collection contains the specified dividend.
public bool Contains(Dividend dividend)
Parameters
dividend
Dividend
Returns
Contains(DateTime)
Returns true if the collection contains the specified ex-date.
public bool Contains(DateTime exDate)
Parameters
exDate
DateTime
Returns
Contains(string)
Returns true if the collection contains the specified symbol.
public bool Contains(string symbol)
Parameters
symbol
string
Returns
CopyTo(Dividend[], int)
Copies the collection to an array.
protected void CopyTo(Dividend[] array, int arrayIndex)
Parameters
GetEnumerator()
Returns an enumerator that iterates through the collection of dividends.
public IEnumerator<Dividend> GetEnumerator()
Returns
Remove(Dividend)
Removes the specified dividend.
public bool Remove(Dividend dividend)
Parameters
dividend
Dividend
Returns
ToString()
Returns a string representation of this object.
public override string ToString()