1 #Region "Microsoft.VisualBasic::03840e92dadaedb580357228c58ffd53, Microsoft.VisualBasic.Core\ComponentModel\Ranges\RangeModel\IRanges.vb"
2
3     ' Author:
4     
5     '       asuka (amethyst.asuka@gcmodeller.org)
6     '       xie (genetics@smrucc.org)
7     '       xieguigang (xie.guigang@live.com)
8     
9     ' Copyright (c) 2018 GPL3 Licensed
10     
11     
12     ' GNU GENERAL PUBLIC LICENSE (GPL3)
13     
14     
15     ' This program is free software: you can redistribute it and/or modify
16     ' it under the terms of the GNU General Public License as published by
17     ' the Free Software Foundation, either version 3 of the License, or
18     ' (at your option) any later version.
19     
20     ' This program is distributed in the hope that it will be useful,
21     ' but WITHOUT ANY WARRANTY; without even the implied warranty of
22     ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23     ' GNU General Public License for more details.
24     
25     ' You should have received a copy of the GNU General Public License
26     ' along with this program. If not, see <http://www.gnu.org/licenses/>.
27
28
29
30     ' /********************************************************************************/
31
32     ' Summaries:
33
34     '     Interface IRange
35     
36     '         Properties: Max, Min
37     
38     '     Interface IRanges
39     
40     '         Function: (+2 OverloadsIsInside, IsOverlapping
41     
42     
43     ' /********************************************************************************/
44
45 #End Region
46
47 Namespace ComponentModel.Ranges.Model
48
49     Public Interface IRange(Of T As IComparable)
50
51         ''' <summary>
52         ''' Minimum value
53         ''' </summary>
54         ReadOnly Property Min As T
55
56         ''' <summary>
57         ''' Maximum value
58         ''' </summary>
59         ReadOnly Property Max As T
60
61     End Interface
62
63     ''' <summary>
64     ''' Represents a generic range with minimum and maximum values
65     ''' </summary>
66     ''' <typeparam name="T"></typeparam>
67     Public Interface IRanges(Of T As IComparable)
68         Inherits IRange(Of T)
69
70         ''' <summary>
71         ''' Check if the specified value is inside this range
72         ''' </summary>
73         ''' <param name="x">Value to check</param>
74         ''' <returns><b>True</b> if the specified value is inside this range or
75         ''' <b>false</b> otherwise.</returns>
76         Function IsInside(x As T) As Boolean
77
78         ''' <summary>
79         ''' Check if the specified range is inside this range
80         ''' </summary>
81         ''' <param name="range">Range to check</param>
82         ''' <returns><b>True</b> if the specified range is inside this range or
83         ''' <b>false</b> otherwise.</returns>
84         Function IsInside(range As IRanges(Of T)) As Boolean
85
86         ''' <summary>
87         ''' Check if the specified range overlaps with this range
88         ''' </summary>
89         ''' <param name="range">Range to check for overlapping</param>
90         ''' <returns><b>True</b> if the specified range overlaps with this range or
91         ''' <b>false</b> otherwise.</returns>
92         Function IsOverlapping(range As IRanges(Of T)) As Boolean
93     End Interface
94 End Namespace