Struct Interval<T>
Represents a interval between two points on the same dimension.
Encoding boundness is left up to the type used.
Assembly: Acoustics.Shared.dll
Syntax
public readonly struct Interval<T> : IEquatable<Interval<T>>, IComparable<Interval<T>> where T : struct, IComparable<T>, IFormattable
Type Parameters
Name |
Description |
T |
The type used to represent the points in this interval.
|
Constructors
|
Improve this Doc
View Source
Interval(T, T)
Declaration
public Interval(T minimum, T maximum)
Parameters
Type |
Name |
Description |
T |
minimum |
|
T |
maximum |
|
|
Improve this Doc
View Source
Interval(T, T, Topology)
Declaration
public Interval(T minimum, T maximum, Topology topology)
Parameters
Type |
Name |
Description |
T |
minimum |
|
T |
maximum |
|
Topology |
topology |
|
Properties
|
Improve this Doc
View Source
IsClosed
Declaration
public readonly bool IsClosed { get; }
Property Value
|
Improve this Doc
View Source
IsDefault
Declaration
public readonly bool IsDefault { get; }
Property Value
|
Improve this Doc
View Source
IsDegenerate
Declaration
public readonly bool IsDegenerate { get; }
Property Value
|
Improve this Doc
View Source
IsEmpty
Declaration
public readonly bool IsEmpty { get; }
Property Value
|
Improve this Doc
View Source
IsMaximumInclusive
Declaration
public readonly bool IsMaximumInclusive { get; }
Property Value
|
Improve this Doc
View Source
IsMinimumInclusive
Declaration
public readonly bool IsMinimumInclusive { get; }
Property Value
|
Improve this Doc
View Source
IsOpen
Declaration
public readonly bool IsOpen { get; }
Property Value
|
Improve this Doc
View Source
IsProper
Declaration
public readonly bool IsProper { get; }
Property Value
|
Improve this Doc
View Source
Maximum
Declaration
public readonly T Maximum { get; }
Property Value
|
Improve this Doc
View Source
Minimum
Declaration
public readonly T Minimum { get; }
Property Value
|
Improve this Doc
View Source
Topology
Gets the type of topology this interval has.
Declaration
public readonly Topology Topology { get; }
Property Value
Methods
|
Improve this Doc
View Source
CombineTopology(Interval<T>)
Declaration
public readonly Topology CombineTopology(Interval<T> second)
Parameters
Type |
Name |
Description |
Interval<T> |
second |
|
Returns
|
Improve this Doc
View Source
CompareTo(Interval<T>)
Declaration
public readonly int CompareTo(Interval<T> other)
Parameters
Returns
|
Improve this Doc
View Source
Contains(T, Topology)
Declaration
public readonly bool Contains(T scalar, Topology type = Topology.LeftClosedRightOpen)
Parameters
Type |
Name |
Description |
T |
scalar |
|
Topology |
type |
|
Returns
|
Improve this Doc
View Source
Contains(Interval<T>)
Declaration
public readonly bool Contains(Interval<T> interval)
Parameters
Type |
Name |
Description |
Interval<T> |
interval |
|
Returns
|
Improve this Doc
View Source
Deconstruct(out T, out T)
Declaration
public readonly void Deconstruct(out T minimum, out T maximum)
Parameters
Type |
Name |
Description |
T |
minimum |
|
T |
maximum |
|
|
Improve this Doc
View Source
Equals(Interval<T>)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(Interval<T> other)
Parameters
Type |
Name |
Description |
Interval<T> |
other |
An object to compare with this object.
|
Returns
Type |
Description |
Boolean |
true if the current object is equal to the other parameter; otherwise, false.
|
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override readonly bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
The obj to compare.
|
Returns
Type |
Description |
Boolean |
True if equal, otherwise false.
|
Overrides
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override readonly int GetHashCode()
Returns
Type |
Description |
Int32 |
Hash Code.
|
Overrides
|
Improve this Doc
View Source
IntersectsWith(Interval<T>)
Declaration
public readonly bool IntersectsWith(Interval<T> interval)
Parameters
Type |
Name |
Description |
Interval<T> |
interval |
|
Returns
|
Improve this Doc
View Source
ToString()
Gets string representation of the Interval.
technically incorrectly representing this value.
Declaration
public override readonly string ToString()
Returns
Type |
Description |
String |
String representation.
|
Overrides
|
Improve this Doc
View Source
ToString(Boolean, String, CultureInfo)
Gets string representation of the Interval.
technically incorrectly representing this value.
Declaration
public readonly string ToString(bool suppressName, string tFormat = "R", CultureInfo culture = null)
Parameters
Type |
Name |
Description |
Boolean |
suppressName |
If true only prints interval data and not type name.
|
String |
tFormat |
|
CultureInfo |
culture |
|
Returns
Type |
Description |
String |
String representation.
|
|
Improve this Doc
View Source
TryGetUnion(Interval<T>, out Interval<T>)
Declaration
public readonly bool TryGetUnion(Interval<T> interval, out Interval<T> union)
Parameters
Returns
Operators
|
Improve this Doc
View Source
Equality(Interval<T>, Interval<T>)
Declaration
public static bool operator ==(Interval<T> first, Interval<T> second)
Parameters
Type |
Name |
Description |
Interval<T> |
first |
The first interval.
|
Interval<T> |
second |
The second interval.
|
Returns
Type |
Description |
Boolean |
True if equal, otherwise false.
|
|
Improve this Doc
View Source
Implicit((T Minimum, T Maximum, Topology Topology) to Interval<T>)
Declaration
public static implicit operator Interval<T>((T Minimum, T Maximum, Topology Topology) item)
Parameters
Returns
|
Improve this Doc
View Source
Implicit((T Minimum, T Maximum) to Interval<T>)
Declaration
public static implicit operator Interval<T>((T Minimum, T Maximum) item)
Parameters
Type |
Name |
Description |
(T1, T2)<T, T> |
item |
|
Returns
|
Improve this Doc
View Source
Inequality(Interval<T>, Interval<T>)
Declaration
public static bool operator !=(Interval<T> first, Interval<T> second)
Parameters
Type |
Name |
Description |
Interval<T> |
first |
The first.
|
Interval<T> |
second |
The second.
|
Returns
Type |
Description |
Boolean |
True if not equals, otherwise false.
|
Implements
Extension Methods