DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Static Public Attributes | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Sql.Objects.SqlYearToMonth Struct Reference

A month span representation of time. More...

Inheritance diagram for Deveel.Data.Sql.Objects.SqlYearToMonth:
Deveel.Data.Sql.Objects.ISqlObject

Public Member Functions

 SqlYearToMonth (int months)
 
 SqlYearToMonth (int years, int months)
 
int IComparable. CompareTo (object obj)
 
int CompareTo (ISqlObject other)
 
bool ISqlObject. IsComparableTo (ISqlObject other)
 Checks if the current object is comparable with the given one. More...
 
int CompareTo (SqlYearToMonth other)
 

Static Public Attributes

static readonly SqlYearToMonth Null = new SqlYearToMonth(true)
 

Properties

bool IsNull [get]
 
int TotalMonths [get]
 Gets the total number of months that represents the time span. More...
 
double TotalYears [get]
 Gets the total number of years that represents the time span. More...
 
- Properties inherited from Deveel.Data.Sql.Objects.ISqlObject
bool IsNull [get]
 Gets a boolean value indicating if the object is NULL. More...
 

Private Member Functions

 SqlYearToMonth (bool isNull)
 

Private Attributes

int months
 

Detailed Description

A month span representation of time.

Definition at line 23 of file SqlYearToMonth.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Objects.SqlYearToMonth.SqlYearToMonth ( int  months)
inline

Definition at line 28 of file SqlYearToMonth.cs.

29  : this() {
30  this.months = months;
31  }
Deveel.Data.Sql.Objects.SqlYearToMonth.SqlYearToMonth ( int  years,
int  months 
)
inline

Definition at line 33 of file SqlYearToMonth.cs.

34  : this((years*12) + months) {
35  }
Deveel.Data.Sql.Objects.SqlYearToMonth.SqlYearToMonth ( bool  isNull)
inlineprivate

Definition at line 37 of file SqlYearToMonth.cs.

38  : this() {
39  if (isNull)
40  months = null;
41  }

Member Function Documentation

int IComparable. Deveel.Data.Sql.Objects.SqlYearToMonth.CompareTo ( object  obj)
inline

Definition at line 43 of file SqlYearToMonth.cs.

43  {
44  return CompareTo((ISqlObject) obj);
45  }
int IComparable. CompareTo(object obj)
int Deveel.Data.Sql.Objects.SqlYearToMonth.CompareTo ( ISqlObject  other)
inline

Definition at line 47 of file SqlYearToMonth.cs.

47  {
48  if (other is SqlYearToMonth)
49  return CompareTo((SqlYearToMonth) other);
50 
51  throw new NotSupportedException();
52  }
int IComparable. CompareTo(object obj)
int Deveel.Data.Sql.Objects.SqlYearToMonth.CompareTo ( SqlYearToMonth  other)
inline

Definition at line 90 of file SqlYearToMonth.cs.

90  {
91  if (other.IsNull && IsNull)
92  return 0;
93  if (IsNull && !other.IsNull)
94  return 1;
95  if (!IsNull && other.IsNull)
96  return -1;
97 
98  return months.Value.CompareTo(other.months.Value);
99  }
bool ISqlObject. Deveel.Data.Sql.Objects.SqlYearToMonth.IsComparableTo ( ISqlObject  other)
inline

Checks if the current object is comparable with the given one.

Parameters
otherThe other ISqlObject to compare.
Returns
Returns true if the current object is comparable with the given one, false otherwise.

Implements Deveel.Data.Sql.Objects.ISqlObject.

Definition at line 83 of file SqlYearToMonth.cs.

83  {
84  return other is SqlYearToMonth ||
85  other is SqlNumber ||
86  other is SqlDayToSecond;
87  }

Member Data Documentation

int Deveel.Data.Sql.Objects.SqlYearToMonth.months
private

Definition at line 24 of file SqlYearToMonth.cs.

readonly SqlYearToMonth Deveel.Data.Sql.Objects.SqlYearToMonth.Null = new SqlYearToMonth(true)
static

Definition at line 26 of file SqlYearToMonth.cs.

Property Documentation

bool Deveel.Data.Sql.Objects.SqlYearToMonth.IsNull
get

Definition at line 55 of file SqlYearToMonth.cs.

int Deveel.Data.Sql.Objects.SqlYearToMonth.TotalMonths
get

Gets the total number of months that represents the time span.

Definition at line 62 of file SqlYearToMonth.cs.

double Deveel.Data.Sql.Objects.SqlYearToMonth.TotalYears
get

Gets the total number of years that represents the time span.

Definition at line 74 of file SqlYearToMonth.cs.


The documentation for this struct was generated from the following file: