C# Class HandCoded.Finance.Calendar

Calendar instances implement the rules for determining if a Date is a business day in the location it represents.

The rules for public holidays vary from country to country but with the exception of special occaisions (e.g. royal weddings, funerals, etc.) can usually be predicted years in advance.

On first reference this class bootstraps an initial set of Calendar instances by processing a XML data file.
Afficher le fichier Open project: formicary/fpml-toolkit-csharp Class Usage Examples

Méthodes publiques

Méthode Description
ForName ( string name ) : Calendar

If a Calendar with the given name exists in the extent set then a reference to it is returned to the caller.

IsBusinessDay ( Date date ) : bool

Determines if the Date provided falls on a business day in this Calendar (e.g. not a holiday or weekend).

ToString ( ) : string

Produces a debugging string describing the instance.

Méthodes protégées

Méthode Description
Calendar ( string name ) : System

Constructs a Calendar instance with a given name.

ToDebug ( ) : string

Produces a debugging string describing the state of the instance.

Private Methods

Méthode Description
Calendar ( ) : System

Initialises the Calendar cache by parsing a standard set of definitions held in a XML file distributed with the toolkit.

ConvertMonth ( string name ) : int
ConvertWeekday ( string name ) : int
ConvertWhen ( string name ) : int
ParseCalendars ( string uri ) : void

Parses the XML data file indicated by the URI to extract default sets of calendars.

Method Details

Calendar() protected méthode

Constructs a Calendar instance with a given name.
protected Calendar ( string name ) : System
name string The reference name for the instance.
Résultat System

ForName() public static méthode

If a Calendar with the given name exists in the extent set then a reference to it is returned to the caller.
public static ForName ( string name ) : Calendar
name string The required Calendar name.
Résultat Calendar

IsBusinessDay() public abstract méthode

Determines if the Date provided falls on a business day in this Calendar (e.g. not a holiday or weekend).
public abstract IsBusinessDay ( Date date ) : bool
date Date The to be tested.
Résultat bool

ToDebug() protected méthode

Produces a debugging string describing the state of the instance.
protected ToDebug ( ) : string
Résultat string

ToString() public méthode

Produces a debugging string describing the instance.
public ToString ( ) : string
Résultat string