Provides static helper method for dealing with objects.
static class
|
SystemUtil
|
Compares values.
public
static
readonly
field
|
CompareBool
|
||
type
|
CompareDelegate<bool>
|
See also:
CompareDelegateCompares values.
public
static
readonly
field
|
CompareChar
|
||
type
|
CompareDelegate<char>
|
See also:
CompareDelegateCompares values.
public
static
readonly
field
|
CompareFloat32
|
||
type
|
CompareDelegate<float32>
|
See also:
CompareDelegateCompares values.
public
static
readonly
field
|
CompareFloat64
|
||
type
|
CompareDelegate<float64>
|
See also:
CompareDelegateCompares values.
public
static
readonly
field
|
CompareInt16
|
||
type
|
CompareDelegate<int16>
|
See also:
CompareDelegateCompares values.
public
static
readonly
field
|
CompareInt32
|
||
type
|
CompareDelegate<int32>
|
See also:
CompareDelegateCompares values.
public
static
readonly
field
|
CompareInt64
|
||
type
|
CompareDelegate<int64>
|
See also:
CompareDelegateCompares values.
public
static
readonly
field
|
CompareInt8
|
||
type
|
CompareDelegate<int8>
|
See also:
CompareDelegateCompares values.
public
static
readonly
field
|
EqualsBool
|
||
type
|
EqualsDelegate<bool>
|
See also:
EqualsDelegateCompares values.
public
static
readonly
field
|
EqualsChar
|
||
type
|
EqualsDelegate<char>
|
See also:
EqualsDelegateCompares values.
public
static
readonly
field
|
EqualsFloat32
|
||
type
|
EqualsDelegate<float32>
|
See also:
EqualsDelegateCompares values.
public
static
readonly
field
|
EqualsFloat64
|
||
type
|
EqualsDelegate<float64>
|
See also:
EqualsDelegateCompares values.
public
static
readonly
field
|
EqualsInt16
|
||
type
|
EqualsDelegate<int16>
|
See also:
EqualsDelegateCompares values.
public
static
readonly
field
|
EqualsInt32
|
||
type
|
EqualsDelegate<int32>
|
See also:
EqualsDelegateCompares values.
public
static
readonly
field
|
EqualsInt64
|
||
type
|
EqualsDelegate<int64>
|
See also:
EqualsDelegateCompares values.
public
static
readonly
field
|
EqualsInt8
|
||
type
|
EqualsDelegate<int8>
|
See also:
EqualsDelegateClears the elements of the given array to the default value.
public
static
method
|
ArrayClear
(bool[] array,
int32 offset = 0,
int32 count = -1)
|
||
params
|
array
|
[not-null]
|
The array to clear. |
offset
|
[>=0]
|
Offset
to
first
element
in
array
to
clear.
Defaults
to
0. |
|
count
|
[>=-1]
|
Number
of
elements
in
array
to
clear.
If
-1 ,
all
remaining
elements
will
be
cleared.
Defaults
to
-1 .
|
Clears the elements of the given array to the default value.
public
static
method
|
ArrayClear
(int8[] array,
int32 offset = 0,
int32 count = -1)
|
||
params
|
array
|
[not-null]
|
The array to clear. |
offset
|
[>=0]
|
Offset
to
first
element
in
array
to
clear.
Defaults
to
0. |
|
count
|
[>=-1]
|
Number
of
elements
in
array
to
clear.
If
-1 ,
all
remaining
elements
will
be
cleared.
Defaults
to
-1 .
|
Clears the elements of the given array to the default value.
public
static
method
|
ArrayClear
(char[] array,
int32 offset = 0,
int32 count = -1)
|
||
params
|
array
|
[not-null]
|
The array to clear. |
offset
|
[>=0]
|
Offset
to
first
element
in
array
to
clear.
Defaults
to
0. |
|
count
|
[>=-1]
|
Number
of
elements
in
array
to
clear.
If
-1 ,
all
remaining
elements
will
be
cleared.
Defaults
to
-1 .
|
Clears the elements of the given array to the default value.
public
static
method
|
ArrayClear
(int16[] array,
int32 offset = 0,
int32 count = -1)
|
||
params
|
array
|
[not-null]
|
The array to clear. |
offset
|
[>=0]
|
Offset
to
first
element
in
array
to
clear.
Defaults
to
0. |
|
count
|
[>=-1]
|
Number
of
elements
in
array
to
clear.
If
-1 ,
all
remaining
elements
will
be
cleared.
Defaults
to
-1 .
|
Clears the elements of the given array to the default value.
public
static
method
|
ArrayClear
(int32[] array,
int32 offset = 0,
int32 count = -1)
|
||
params
|
array
|
[not-null]
|
The array to clear. |
offset
|
[>=0]
|
Offset
to
first
element
in
array
to
clear.
Defaults
to
0. |
|
count
|
[>=-1]
|
Number
of
elements
in
array
to
clear.
If
-1 ,
all
remaining
elements
will
be
cleared.
Defaults
to
-1 .
|
Clears the elements of the given array to the default value.
public
static
method
|
ArrayClear
(float32[] array,
int32 offset = 0,
int32 count = -1)
|
||
params
|
array
|
[not-null]
|
The array to clear. |
offset
|
[>=0]
|
Offset
to
first
element
in
array
to
clear.
Defaults
to
0. |
|
count
|
[>=-1]
|
Number
of
elements
in
array
to
clear.
If
-1 ,
all
remaining
elements
will
be
cleared.
Defaults
to
-1 .
|
Clears the elements of the given array to the default value.
public
static
method
|
ArrayClear
(int64[] array,
int32 offset = 0,
int32 count = -1)
|
||
params
|
array
|
[not-null]
|
The array to clear. |
offset
|
[>=0]
|
Offset
to
first
element
in
array
to
clear.
Defaults
to
0. |
|
count
|
[>=-1]
|
Number
of
elements
in
array
to
clear.
If
-1 ,
all
remaining
elements
will
be
cleared.
Defaults
to
-1 .
|
Clears the elements of the given array to the default value.
public
static
method
|
ArrayClear
(float64[] array,
int32 offset = 0,
int32 count = -1)
|
||
params
|
array
|
[not-null]
|
The array to clear. |
offset
|
[>=0]
|
Offset
to
first
element
in
array
to
clear.
Defaults
to
0. |
|
count
|
[>=-1]
|
Number
of
elements
in
array
to
clear.
If
-1 ,
all
remaining
elements
will
be
cleared.
Defaults
to
-1 .
|
Copies elements from one array to another.
public
static
method
|
ArrayCopy
([]
bool[] source,
int32 sourceIdx,
[]
bool[] target,
int32 targetIdx,
int32 count)
|
||
params
|
source
|
[not-null]
|
The source array. |
sourceIdx
|
[>=0]
|
Index of first element in source to copy. | |
target
|
[not-null]
|
The target array. | |
targetIdx
|
[>=0]
|
Index of first element in target to write. | |
count
|
[>=0]
|
Total number of array elements to copy. |
Copies elements from one array to another.
public
static
method
|
ArrayCopy
([]
int8[] source,
int32 sourceIdx,
[]
int8[] target,
int32 targetIdx,
int32 count)
|
||
params
|
source
|
[not-null]
|
The source array. |
sourceIdx
|
[>=0]
|
Index of first element in source to copy. | |
target
|
[not-null]
|
The target array. | |
targetIdx
|
[>=0]
|
Index of first element in target to write. | |
count
|
[>=0]
|
Total number of array elements to copy. |
Copies elements from one array to another.
public
static
method
|
ArrayCopy
([]
char[] source,
int32 sourceIdx,
[]
char[] target,
int32 targetIdx,
int32 count)
|
||
params
|
source
|
[not-null]
|
The source array. |
sourceIdx
|
[>=0]
|
Index of first element in source to copy. | |
target
|
[not-null]
|
The target array. | |
targetIdx
|
[>=0]
|
Index of first element in target to write. | |
count
|
[>=0]
|
Total number of array elements to copy. |
Copies elements from one array to another.
public
static
method
|
ArrayCopy
([]
int16[] source,
int32 sourceIdx,
[]
int16[] target,
int32 targetIdx,
int32 count)
|
||
params
|
source
|
[not-null]
|
The source array. |
sourceIdx
|
[>=0]
|
Index of first element in source to copy. | |
target
|
[not-null]
|
The target array. | |
targetIdx
|
[>=0]
|
Index of first element in target to write. | |
count
|
[>=0]
|
Total number of array elements to copy. |
Copies elements from one array to another.
public
static
method
|
ArrayCopy
([]
int32[] source,
int32 sourceIdx,
[]
int32[] target,
int32 targetIdx,
int32 count)
|
||
params
|
source
|
[not-null]
|
The source array. |
sourceIdx
|
[>=0]
|
Index of first element in source to copy. | |
target
|
[not-null]
|
The target array. | |
targetIdx
|
[>=0]
|
Index of first element in target to write. | |
count
|
[>=0]
|
Total number of array elements to copy. |
Copies elements from one array to another.
public
static
method
|
ArrayCopy
([]
float32[] source,
int32 sourceIdx,
[]
float32[] target,
int32 targetIdx,
int32 count)
|
||
params
|
source
|
[not-null]
|
The source array. |
sourceIdx
|
[>=0]
|
Index of first element in source to copy. | |
target
|
[not-null]
|
The target array. | |
targetIdx
|
[>=0]
|
Index of first element in target to write. | |
count
|
[>=0]
|
Total number of array elements to copy. |
Copies elements from one array to another.
public
static
method
|
ArrayCopy
([]
int64[] source,
int32 sourceIdx,
[]
int64[] target,
int32 targetIdx,
int32 count)
|
||
params
|
source
|
[not-null]
|
The source array. |
sourceIdx
|
[>=0]
|
Index of first element in source to copy. | |
target
|
[not-null]
|
The target array. | |
targetIdx
|
[>=0]
|
Index of first element in target to write. | |
count
|
[>=0]
|
Total number of array elements to copy. |
Copies elements from one array to another.
public
static
method
|
ArrayCopy
([]
float64[] source,
int32 sourceIdx,
[]
float64[] target,
int32 targetIdx,
int32 count)
|
||
params
|
source
|
[not-null]
|
The source array. |
sourceIdx
|
[>=0]
|
Index of first element in source to copy. | |
target
|
[not-null]
|
The target array. | |
targetIdx
|
[>=0]
|
Index of first element in target to write. | |
count
|
[>=0]
|
Total number of array elements to copy. |
Disposes the given object if it is an instance of IDisposable.
public
static
method
|
Dispose
([Owner]
object obj)
|
||
params
|
obj
|
The
object
or
null . |
public
static
method
|
FuncCompareBool
(bool a,
bool b)
|
||
type
|
int32
|
||
params
|
a
|
||
b
|
public
static
method
|
FuncCompareChar
(char a,
char b)
|
||
type
|
int32
|
||
params
|
a
|
||
b
|
public
static
method
|
FuncCompareFloat32
(float32 a,
float32 b)
|
||
type
|
int32
|
||
params
|
a
|
||
b
|
public
static
method
|
FuncCompareFloat64
(float64 a,
float64 b)
|
||
type
|
int32
|
||
params
|
a
|
||
b
|
public
static
method
|
FuncCompareInt16
(int16 a,
int16 b)
|
||
type
|
int32
|
||
params
|
a
|
||
b
|
public
static
method
|
FuncCompareInt32
(int32 a,
int32 b)
|
||
type
|
int32
|
||
params
|
a
|
||
b
|
public
static
method
|
FuncCompareInt64
(int64 a,
int64 b)
|
||
type
|
int32
|
||
params
|
a
|
||
b
|
public
static
method
|
FuncCompareInt8
(int8 a,
int8 b)
|
||
type
|
int32
|
||
params
|
a
|
||
b
|
Grows the given capacity, making sure it stays within [0..2147483647] and is larger than or equal to required.
[Pure]
|
||||
public
static
method
|
GrowCapacity
(int32 current,
int64 required = 0,
int32 numerator = 5,
int32 denominator = 4)
|
|||
type
|
int32
|
|||
params
|
current
|
The current capacity. | ||
required
|
The
required
capacity.
Defaults
to
0 . |
|||
numerator
|
Numerator
of
fraction
to
use
for
growing
current.
Defaults
to
5 .
|
|||
denominator
|
Denominator
of
fraction
to
use
for
growing
current.
Defaults
to
4 .
|
|||
returns
|
|
The grown capacity. |
Exceptions:
2147483647
.
Is this object valid (see remarks)?
public
static
method
|
IsValid
(object obj)
|
||
type
|
bool
|
||
params
|
obj
|
The object to check. | |
returns
|
true
if
the
object
is
valid,
false
if
not. |
Remarks:
An object is considered valid if it is in one of the following lifecycle states:
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(IMemoryConsumption thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(ByteBuffer thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(object thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(bool[] thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(int8[] thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(int16[] thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(int32[] thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(int64[] thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(float32[] thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Returns the estimated memory consumption of the given thing.
[Pure]
|
||||
public
static
method
|
MemoryConsumptionOf
(float64[] thing)
|
|||
type
|
int64
|
|||
params
|
thing
|
The thing. | ||
returns
|
|
The estimated memory consumption, in bytes. |
Sorts the given values.
[Pure]
|
||||
public
static
method
|
Sort4
(float64 d0,
float64 d1,
float64 d2,
float64 d3)
|
|||
type
|
int32
|
|||
params
|
d0
|
First value to sort. | ||
d1
|
Second value to sort. | |||
d2
|
Third value to sort. | |||
d3
|
Fourth value to sort. | |||
returns
|
Bits
0..1
:
sort
order
index
of
d0 Bits 2..3 : sort order index of d1 Bits 4..5 : sort order index of d2 Bits 6..7 : sort order index of d3 |
Returns the number of bytes that are required to encode the given value using variable coding from one to nine bytes.
[Pure]
|
||||
public
static
method
|
VarIntLength
(int64 value)
|
|||
type
|
int32
|
|||
params
|
value
|
The value to encode. | ||
returns
|
|
The number of required bytes. |
Reads a signed 64-bit value from the IDataStream using variable coding from one to nine bytes.
public
static
method
|
VarIntRead
(IBinaryReader stream)
|
||
type
|
int64
|
||
params
|
stream
|
[not-null]
|
The input data stream. |
returns
|
The read value. |
Remarks:
The encoding is independent on byte endianess.
See also:
SystemUtilReads a signed 64-bit value from the ByteBuffer using variable coding from one to nine bytes.
public
static
method
|
VarIntRead
(ByteBuffer buffer)
|
||
type
|
int64
|
||
params
|
buffer
|
[not-null]
|
The input byte buffer. |
returns
|
The read value. |
Remarks:
The encoding is independent on byte endianess.
See also:
SystemUtilWrites a signed 64-bit value to the IDataStream using variable coding from one to nine bytes.
public
static
method
|
VarIntWrite
(IBinaryWriter stream,
int64 value)
|
||
params
|
stream
|
[not-null]
|
The output stream. |
value
|
The value to write. |
Remarks:
The encoding is independent on byte endianess.
See also:
SystemUtilWrites a signed 64-bit value to the ByteBuffer using variable coding from one to nine bytes.
public
static
method
|
VarIntWrite
(ByteBuffer buffer,
int64 value)
|
||
params
|
buffer
|
[not-null]
|
The output byte buffer. |
value
|
The value to write. |
Remarks:
The encoding is independent on byte endianess.
See also:
SystemUtil