SystemEX  Lacking
Additional generic collection types missing in .net
SystemEx.Triple Struct Reference

Represents a three-valued logic value. More...

Inheritance diagram for SystemEx.Triple:
Collaboration diagram for SystemEx.Triple:

Public Member Functions

override int GetHashCode ()
 Gets the hash code for the current instance.
override string ToString ()
 Returns a string that represents the current instance.
 Triple ()
 Initializes a new instance of the Triple struct.
 Triple (bool v)
 Initializes a new instance of the Triple struct.
 Triple (triple v)
 Initializes a new instance of the Triple struct.
override bool Equals ([NotNullWhen(true)] object? obj)
 Determines whether the current instance and a specified object are equal.
bool Equals (bool obj)
 Determines whether the current instance and a specified boolean value are equal.
bool ToBoolean ()
 Returns the boolean value of the current instance.
bool Equals (triple obj)
 Determines whether the current instance and a specified triple value are equal.

Static Public Member Functions

static bool operator== (Triple left, Triple right)
 Determines whether two instances of the Triple struct are equal.
static bool operator== (Triple left, bool right)
 Determines whether an instance of the Triple struct and a boolean value are equal.
static bool operator== (bool left, Triple right)
 Determines whether a boolean value and an instance of the Triple struct are equal.
static bool operator!= (Triple left, Triple right)
 Determines whether two instances of the Triple struct are not equal.
static bool operator!= (Triple left, bool right)
 Determines whether an instance of the Triple struct and a boolean value are not equal.
static bool operator!= (bool left, Triple right)
 Determines whether a boolean value and an instance of the Triple struct are not equal.

Static Public Attributes

static readonly string TrueString = "True"
 Gets the string representation for the true value.
static readonly string FalseString = "False"
 Gets the string representation for the false value.
static readonly string NinString = "Nin"
 Gets the string representation for the neither true nor false value.

Detailed Description

Represents a three-valued logic value.

Constructor & Destructor Documentation

◆ Triple() [1/3]

SystemEx.Triple.Triple ( )

Initializes a new instance of the Triple struct.

93 {
94 m_value = triple.Nin;
95 }
triple
Represents a three-valued logic type with True, False, and Nin (neither true nor false) states.
Definition Base/Triple.cs:23
Here is the caller graph for this function:

◆ Triple() [2/3]

SystemEx.Triple.Triple ( bool v)

Initializes a new instance of the Triple struct.

Parameters
vThe boolean value to initialize with.
100 {
101 m_value = v ? triple.True : triple.False;
102 }

◆ Triple() [3/3]

SystemEx.Triple.Triple ( triple v)

Initializes a new instance of the Triple struct.

Parameters
vThe triple value to initialize with.
107 {
108 m_value = v;
109 }

Member Function Documentation

◆ Equals() [1/3]

override bool SystemEx.Triple.Equals ( [NotNullWhen(true)] object? obj)

Determines whether the current instance and a specified object are equal.

Parameters
objThe object to compare with the current instance.
Returns
true if the current instance and obj are equal; otherwise, false.
116 {
117 bool _ret = false;
118
119 if( (obj is Boolean) ) _ret = ((Boolean)obj == this.ToBoolean());
120 else if ( (obj is Triple) ) _ret = m_value == ((Triple)obj).m_value;
121
122 return _ret;
123 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Equals() [2/3]

bool SystemEx.Triple.Equals ( bool obj)

Determines whether the current instance and a specified boolean value are equal.

Parameters
objThe boolean value to compare with the current instance.
Returns
true if the current instance and obj are equal; otherwise, false.
131 {
132 return ToBoolean() == obj;
133 }
Here is the call graph for this function:

◆ Equals() [3/3]

bool SystemEx.Triple.Equals ( triple obj)

Determines whether the current instance and a specified triple value are equal.

Parameters
objThe triple value to compare with the current instance.
Returns
true if the current instance and obj are equal; otherwise, false.
146 {
147 return m_value == obj;
148 }

◆ GetHashCode()

override int SystemEx.Triple.GetHashCode ( )

Gets the hash code for the current instance.

Returns
The hash code.
69 {
70 if ( m_value == True ) return 1;
71 if ( m_value == False ) return 0;
72 return -1;
73 }

◆ operator!=() [1/3]

bool SystemEx.Triple.operator!= ( bool left,
Triple right )
static

Determines whether a boolean value and an instance of the Triple struct are not equal.

Parameters
leftThe boolean value to compare.
rightThe instance of the Triple struct to compare with the boolean value.
Returns
true if the boolean value and the instance are not equal; otherwise, false.
202 {
203 return !(right.Equals(left));
204 }
Here is the call graph for this function:

◆ operator!=() [2/3]

bool SystemEx.Triple.operator!= ( Triple left,
bool right )
static

Determines whether an instance of the Triple struct and a boolean value are not equal.

Parameters
leftThe instance of the Triple struct to compare.
rightThe boolean value to compare with the instance.
Returns
true if the instance and the boolean value are not equal; otherwise, false.
193 {
194 return !(left.Equals(right));
195 }
Here is the call graph for this function:

◆ operator!=() [3/3]

bool SystemEx.Triple.operator!= ( Triple left,
Triple right )
static

Determines whether two instances of the Triple struct are not equal.

Parameters
leftThe first instance to compare.
rightThe second instance to compare.
Returns
true if the instances are not equal; otherwise, false.
184 {
185 return !(left.Equals(right));
186 }
Here is the call graph for this function:

◆ operator==() [1/3]

bool SystemEx.Triple.operator== ( bool left,
Triple right )
static

Determines whether a boolean value and an instance of the Triple struct are equal.

Parameters
leftThe boolean value to compare.
rightThe instance of the Triple struct to compare with the boolean value.
Returns
true if the boolean value and the instance are equal; otherwise, false.
175 {
176 return right.Equals(left);
177 }
Here is the call graph for this function:

◆ operator==() [2/3]

bool SystemEx.Triple.operator== ( Triple left,
bool right )
static

Determines whether an instance of the Triple struct and a boolean value are equal.

Parameters
leftThe instance of the Triple struct to compare.
rightThe boolean value to compare with the instance.
Returns
true if the instance and the boolean value are equal; otherwise, false.
165 {
166 return left.Equals(right);
167 }
Here is the call graph for this function:

◆ operator==() [3/3]

bool SystemEx.Triple.operator== ( Triple left,
Triple right )
static

Determines whether two instances of the Triple struct are equal.

Parameters
leftThe first instance to compare.
rightThe second instance to compare.
Returns
true if the instances are equal; otherwise, false.
155 {
156 return left.Equals(right);
157 }
Here is the call graph for this function:

◆ ToBoolean()

bool SystemEx.Triple.ToBoolean ( )

Returns the boolean value of the current instance.

Returns
The boolean value of the current instance.
138 {
139 return m_value == triple.True;
140 }
Here is the caller graph for this function:

◆ ToString()

override string SystemEx.Triple.ToString ( )

Returns a string that represents the current instance.

Returns
A string that represents the current instance.
79 {
80 string _ret = NinString;
81
82 if ( m_value == triple.False) {
83 _ret = FalseString;
84 } else if ( m_value == triple.True )
85 _ret = TrueString;
86
87 return _ret;
88 }

Member Data Documentation

◆ FalseString

readonly string SystemEx.Triple.FalseString = "False"
static

Gets the string representation for the false value.

◆ NinString

readonly string SystemEx.Triple.NinString = "Nin"
static

Gets the string representation for the neither true nor false value.

◆ TrueString

readonly string SystemEx.Triple.TrueString = "True"
static

Gets the string representation for the true value.


The documentation for this struct was generated from the following file:
  • Base/Triple.cs