Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlDoubleSortKey.cs
Go to the documentation of this file.
1
namespace
System.Xml.Xsl.Runtime
;
2
3
internal
sealed
class
XmlDoubleSortKey
:
XmlSortKey
4
{
5
private
readonly
double
_dblVal
;
6
7
private
readonly
bool
_isNaN
;
8
9
public
XmlDoubleSortKey
(
double
value
,
XmlCollation
collation
)
10
{
11
if
(
double
.IsNaN(
value
))
12
{
13
_isNaN
=
true
;
14
_dblVal
= ((
collation.EmptyGreatest
!=
collation
.DescendingOrder) ?
double
.PositiveInfinity :
double
.NegativeInfinity);
15
}
16
else
17
{
18
_dblVal
= (
collation.DescendingOrder
? (0.0 -
value
) :
value
);
19
}
20
}
21
22
public
override
int
CompareTo
(
object
obj
)
23
{
24
if
(!(
obj
is
XmlDoubleSortKey
xmlDoubleSortKey
))
25
{
26
if
(
_isNaN
)
27
{
28
return
BreakSortingTie
(
obj
as
XmlSortKey
);
29
}
30
return
CompareToEmpty
(
obj
);
31
}
32
if
(
_dblVal
==
xmlDoubleSortKey
._dblVal)
33
{
34
if
(
_isNaN
)
35
{
36
if
(
xmlDoubleSortKey
._isNaN)
37
{
38
return
BreakSortingTie
(
xmlDoubleSortKey
);
39
}
40
if
(
_dblVal
!=
double
.NegativeInfinity)
41
{
42
return
1;
43
}
44
return
-1;
45
}
46
if
(
xmlDoubleSortKey
._isNaN)
47
{
48
if
(
xmlDoubleSortKey
._dblVal !=
double
.NegativeInfinity)
49
{
50
return
-1;
51
}
52
return
1;
53
}
54
return
BreakSortingTie
(
xmlDoubleSortKey
);
55
}
56
if
(!(
_dblVal
<
xmlDoubleSortKey
._dblVal))
57
{
58
return
1;
59
}
60
return
-1;
61
}
62
}
System.Xml.Xsl.Runtime.XmlCollation
Definition
XmlCollation.cs:9
System.Xml.Xsl.Runtime.XmlDoubleSortKey.CompareTo
override int CompareTo(object obj)
Definition
XmlDoubleSortKey.cs:22
System.Xml.Xsl.Runtime.XmlDoubleSortKey._dblVal
readonly double _dblVal
Definition
XmlDoubleSortKey.cs:5
System.Xml.Xsl.Runtime.XmlDoubleSortKey.XmlDoubleSortKey
XmlDoubleSortKey(double value, XmlCollation collation)
Definition
XmlDoubleSortKey.cs:9
System.Xml.Xsl.Runtime.XmlDoubleSortKey._isNaN
readonly bool _isNaN
Definition
XmlDoubleSortKey.cs:7
System.Xml.Xsl.Runtime.XmlDoubleSortKey
Definition
XmlDoubleSortKey.cs:4
System.Xml.Xsl.Runtime.XmlSortKey.BreakSortingTie
int BreakSortingTie(XmlSortKey that)
Definition
XmlSortKey.cs:33
System.Xml.Xsl.Runtime.XmlSortKey.CompareToEmpty
int CompareToEmpty(object obj)
Definition
XmlSortKey.cs:46
System.Xml.Xsl.Runtime.XmlSortKey
Definition
XmlSortKey.cs:4
System.Xml.Xsl.Runtime
Definition
AncestorDocOrderIterator.cs:4
System.Xml.ValueHandleType.Dictionary
@ Dictionary
System.ExceptionArgument.value
@ value
System.ExceptionArgument.obj
@ obj
source
System.Private.Xml
System.Xml.Xsl.Runtime
XmlDoubleSortKey.cs
Generated by
1.10.0