C# Class HandCoded.Finance.Interval

An Interval is a length of time expressed as an integer multiple of some Period, for example five days or three months.
Afficher le fichier Open project: formicary/fpml-toolkit-csharp Class Usage Examples

Méthodes publiques

Méthode Description
DividesDates ( Date first, Date last ) : bool

Determines if an Interval will divide the time period delimited by two dates exactly.

Equals ( Interval other ) : bool

Compares two Interval instance to see if they contain the same information.

This routine takes into account the equivalence of certain time intervals (e.g. 1Y = 12M and 1W = 7D).

Equals ( object other ) : bool

Compares an Interval instance with another object to see if they contain the same information.

This routine takes into account the equivalence of certain time intervals (e.g. 1Y = 12M and 1W = 7D).

GetHashCode ( ) : int

Produces a hash value for the instance.

Interval ( int multiplier, Period period ) : System

Constructs an Interval from the provided multiplier and time unit.

Interval ( int multiplier, string code ) : System

Constructs an Interval from the provided multiplier and time unit code.

IsMultipleOf ( Interval other ) : bool

Determines if this Interval is an integer multiple of another.

The calculation recognises that a week is seven days and that a year is twelve months. It also allows 1T to match any time period longer than a day and for any time period to be a multiple of 1 day.

Plus ( Interval other ) : Interval

Calculates the result of adding another Interval to this one.

ToString ( ) : string

Creates a debugging string describing the instance.

Method Details

DividesDates() public méthode

Determines if an Interval will divide the time period delimited by two dates exactly.
public DividesDates ( Date first, Date last ) : bool
first Date The first date.
last Date The last date.
Résultat bool

Equals() public méthode

Compares two Interval instance to see if they contain the same information.
This routine takes into account the equivalence of certain time intervals (e.g. 1Y = 12M and 1W = 7D).
public Equals ( Interval other ) : bool
other Interval The other Interval instance.
Résultat bool

Equals() public méthode

Compares an Interval instance with another object to see if they contain the same information.
This routine takes into account the equivalence of certain time intervals (e.g. 1Y = 12M and 1W = 7D).
public Equals ( object other ) : bool
other object The to compare with.
Résultat bool

GetHashCode() public méthode

Produces a hash value for the instance.
public GetHashCode ( ) : int
Résultat int

Interval() public méthode

Constructs an Interval from the provided multiplier and time unit.
public Interval ( int multiplier, Period period ) : System
multiplier int The time period multiplier.
period Period The time period unit.
Résultat System

Interval() public méthode

Constructs an Interval from the provided multiplier and time unit code.
public Interval ( int multiplier, string code ) : System
multiplier int The time period unit multiplier.
code string The timer period unit code
Résultat System

IsMultipleOf() public méthode

Determines if this Interval is an integer multiple of another.
The calculation recognises that a week is seven days and that a year is twelve months. It also allows 1T to match any time period longer than a day and for any time period to be a multiple of 1 day.
public IsMultipleOf ( Interval other ) : bool
other Interval The other Interval instance.
Résultat bool

Plus() public méthode

Calculates the result of adding another Interval to this one.
If the two time periods /// cannot be combined.
public Plus ( Interval other ) : Interval
other Interval The Interval to add.
Résultat Interval

ToString() public méthode

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