microsoft-visualbasic-runtime/ComponentModel/Ranges/RangeModel/IRangeModel.vb

95 lines
3.1 KiB
VB.net
Raw Normal View History

2020-03-28 15:44:37 +08:00
#Region "Microsoft.VisualBasic::59eb37d2a374c04c979f9f4952ad4a57, Microsoft.VisualBasic.Core\ComponentModel\Ranges\RangeModel\IRangeModel.vb"
2018-08-02 20:14:48 +08:00
' Author:
'
' asuka (amethyst.asuka@gcmodeller.org)
' xie (genetics@smrucc.org)
' xieguigang (xie.guigang@live.com)
'
' Copyright (c) 2018 GPL3 Licensed
'
'
' GNU GENERAL PUBLIC LICENSE (GPL3)
'
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program. If not, see <http://www.gnu.org/licenses/>.
' /********************************************************************************/
' Summaries:
' Interface IRange
'
' Properties: Max, Min
'
2020-03-28 15:44:37 +08:00
' Interface IRangeModel
2018-08-02 20:14:48 +08:00
'
' Function: (+2 Overloads) IsInside, IsOverlapping
'
'
' /********************************************************************************/
#End Region
Namespace ComponentModel.Ranges.Model
Public Interface IRange(Of T As IComparable)
''' <summary>
''' Minimum value
''' </summary>
ReadOnly Property Min As T
''' <summary>
''' Maximum value
''' </summary>
ReadOnly Property Max As T
End Interface
''' <summary>
''' Represents a generic range with minimum and maximum values
''' </summary>
''' <typeparam name="T"></typeparam>
2020-03-08 08:11:08 +08:00
Public Interface IRangeModel(Of T As IComparable)
2018-08-02 20:14:48 +08:00
Inherits IRange(Of T)
''' <summary>
''' Check if the specified value is inside this range
''' </summary>
''' <param name="x">Value to check</param>
''' <returns><b>True</b> if the specified value is inside this range or
''' <b>false</b> otherwise.</returns>
Function IsInside(x As T) As Boolean
''' <summary>
''' Check if the specified range is inside this range
''' </summary>
''' <param name="range">Range to check</param>
''' <returns><b>True</b> if the specified range is inside this range or
''' <b>false</b> otherwise.</returns>
2020-03-08 08:11:08 +08:00
Function IsInside(range As IRangeModel(Of T)) As Boolean
2018-08-02 20:14:48 +08:00
''' <summary>
''' Check if the specified range overlaps with this range
''' </summary>
''' <param name="range">Range to check for overlapping</param>
''' <returns><b>True</b> if the specified range overlaps with this range or
''' <b>false</b> otherwise.</returns>
2020-03-08 08:11:08 +08:00
Function IsOverlapping(range As IRangeModel(Of T)) As Boolean
2018-08-02 20:14:48 +08:00
End Interface
End Namespace