<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
h1
        {mso-style-priority:9;
        mso-style-link:"Überschrift 1 Zchn";
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:24.0pt;
        font-family:"Times New Roman","serif";
        font-weight:bold;}
h2
        {mso-style-priority:9;
        mso-style-link:"Überschrift 2 Zchn";
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:18.0pt;
        font-family:"Times New Roman","serif";
        font-weight:bold;}
h3
        {mso-style-priority:9;
        mso-style-link:"Überschrift 3 Zchn";
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:13.5pt;
        font-family:"Times New Roman","serif";
        font-weight:bold;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
span.berschrift3Zchn
        {mso-style-name:"Überschrift 3 Zchn";
        mso-style-priority:9;
        mso-style-link:"Überschrift 3";
        font-family:"Cambria","serif";
        color:#4F81BD;
        font-weight:bold;}
span.berschrift1Zchn
        {mso-style-name:"Überschrift 1 Zchn";
        mso-style-priority:9;
        mso-style-link:"Überschrift 1";
        font-family:"Cambria","serif";
        color:#365F91;
        font-weight:bold;}
span.berschrift2Zchn
        {mso-style-name:"Überschrift 2 Zchn";
        mso-style-priority:9;
        mso-style-link:"Überschrift 2";
        font-family:"Cambria","serif";
        color:#4F81BD;
        font-weight:bold;}
span.E-MailFormatvorlage23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:34701145;
        mso-list-template-ids:-1859727960;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1
        {mso-list-id:131749397;
        mso-list-template-ids:886455238;}
@list l1:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l2
        {mso-list-id:135342927;
        mso-list-template-ids:-2059080552;}
@list l2:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l3
        {mso-list-id:151877664;
        mso-list-template-ids:1799807722;}
@list l3:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l4
        {mso-list-id:167839977;
        mso-list-template-ids:156271054;}
@list l4:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l4:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l5
        {mso-list-id:242034708;
        mso-list-template-ids:1883825416;}
@list l5:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l6
        {mso-list-id:257911361;
        mso-list-template-ids:-117426100;}
@list l6:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l7
        {mso-list-id:316500744;
        mso-list-template-ids:-1562083202;}
@list l7:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l8
        {mso-list-id:323315121;
        mso-list-template-ids:-38659836;}
@list l8:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l9
        {mso-list-id:417285791;
        mso-list-template-ids:-266685540;}
@list l9:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l10
        {mso-list-id:430394501;
        mso-list-template-ids:-1990833244;}
@list l10:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l11
        {mso-list-id:440882934;
        mso-list-template-ids:-1557916262;}
@list l11:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l12
        {mso-list-id:481770823;
        mso-list-template-ids:547129350;}
@list l12:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l13
        {mso-list-id:517741571;
        mso-list-template-ids:-1470334052;}
@list l13:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l14
        {mso-list-id:773674441;
        mso-list-template-ids:2037700354;}
@list l14:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l15
        {mso-list-id:844369056;
        mso-list-template-ids:-316784946;}
@list l15:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l15:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l16
        {mso-list-id:921567326;
        mso-list-template-ids:2117498240;}
@list l16:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l17
        {mso-list-id:1094285976;
        mso-list-template-ids:-613900274;}
@list l17:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l18
        {mso-list-id:1121919523;
        mso-list-template-ids:-1641099382;}
@list l18:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l19
        {mso-list-id:1137726830;
        mso-list-template-ids:1464775842;}
@list l19:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l20
        {mso-list-id:1241020785;
        mso-list-template-ids:-2062145624;}
@list l20:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l21
        {mso-list-id:1243566127;
        mso-list-template-ids:-1483988422;}
@list l21:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l22
        {mso-list-id:1343046300;
        mso-list-template-ids:561828506;}
@list l22:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l23
        {mso-list-id:1450781392;
        mso-list-template-ids:1912662368;}
@list l23:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l24
        {mso-list-id:1480809616;
        mso-list-template-ids:-1580576428;}
@list l24:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l25
        {mso-list-id:1490755441;
        mso-list-template-ids:-423707222;}
@list l25:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l26
        {mso-list-id:1506164891;
        mso-list-template-ids:1994917322;}
@list l26:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l27
        {mso-list-id:1544368688;
        mso-list-template-ids:1029320856;}
@list l28
        {mso-list-id:1578441353;
        mso-list-template-ids:1365035576;}
@list l28:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l29
        {mso-list-id:1693144440;
        mso-list-template-ids:1497160874;}
@list l29:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l30
        {mso-list-id:1720323928;
        mso-list-template-ids:-2023221276;}
@list l30:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l30:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l31
        {mso-list-id:1874344271;
        mso-list-template-ids:-1269135372;}
@list l31:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l31:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l32
        {mso-list-id:1904872980;
        mso-list-template-ids:-1707700138;}
@list l32:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l33
        {mso-list-id:1976838157;
        mso-list-template-ids:1196345990;}
@list l33:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Why limiting Range to timespans? I once wrote Range<E>, see <a href="https://github.com/headcrashing/treasure-chest/blob/master/RangeClass/src/main/java/eu/headcrashing/java/util/Range.java">https://github.com/headcrashing/treasure-chest/blob/master/RangeClass/src/main/java/eu/headcrashing/java/util/Range.java</a>. I could imagine this is useful<o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></a></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> core-libs-dev [mailto:core-libs-dev-retn@openjdk.org] <b>Im Auftrag von </b>Olexandr Rotan<br><b>Gesendet:</b> Sonntag, 22. September 2024 22:53<br><b>An:</b> Remi Forax<br><b>Cc:</b> core-libs-dev<br><b>Betreff:</b> Re: Range API<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><p>Hello! <br>Thanks for your comments, they are valuable to me. I indeed intended to make Range immutable, if you noticed, in potential methods I listed extendTo and shrinkTo, which is kind of modified with-ers. But, it's indeed better to convert range to class and expose some methods to create bounded and unbounded ones.<o:p></o:p></p><p>The range pattern would be great to have, but unless there is some way to ger range object, there will not me a way to create range arithmetics. It would be better, in my opinion, to create member pattern inside Range class that can match it's type params. This may eliminate need for new syntax for range litterals and make feature more versatile.<o:p></o:p></p><p>Regarding the array return types, I specifically mentioned that this is the first thing up to change. Your point is completely valid, I will look into this issue as soon as possible.<o:p></o:p></p><p>I don't really understand the point about coupling different parts with an interface (future class I guess). Do you say that it is not desirable to have specialized versions of range such as timespan, and would prefer just one generic Range?<o:p></o:p></p><p>I appreciate all feedback you give. I will address your comments as soon as possible. I am new to API design, so I guess people won't go to hard on me. I hope that, iteratively, I could workout the API that would be a good match for JDK quality level.<o:p></o:p></p><p>Best regards<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Sun, Sep 22, 2024, 23:17 Remi Forax <<a href="mailto:forax@univ-mlv.fr">forax@univ-mlv.fr</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'>Hello,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'>if we introduce a Range object, it will have to be an immutable class because otherwise any API that takes an interface Range as parameter will have to copy it into an immutable subclass first;<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'>In term of design, coupling different parts of the JDK with an interface is not appealing to me, especially given that a Range is a very small object.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'>We (the amber EG) have talked about adding a way to do pattern matching using a Range with a special syntax like 1 .. 3, if we introduce such syntax, the runtime representation will be an immutable class an not an interface (think java.lang.String).<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'>Your API is unsafe, you can not have a method that creates a Range<T>[] in a safe way, the combination of erasure + array covariant is nasty (at least until we have a way to create a read-only arrays).<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'>regards,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'>Rémi<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif";color:black'><o:p> </o:p></span></p></div><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Arial","sans-serif";color:black'><hr size=5 width="100%" align=center id="m_1110753311284118601zwchr"></span></div><div><blockquote style='border:none;border-left:solid #1010FF 1.0pt;padding:0cm 0cm 0cm 2.0pt;margin-left:1.65pt;margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><b><span style='font-family:"Helvetica","sans-serif";color:black'>From: </span></b><span style='font-family:"Helvetica","sans-serif";color:black'>"Olexandr Rotan" <<a href="mailto:rotanolexandr842@gmail.com" target="_blank">rotanolexandr842@gmail.com</a>><br><b>To: </b>"core-libs-dev" <<a href="mailto:core-libs-dev@openjdk.org" target="_blank">core-libs-dev@openjdk.org</a>><br><b>Sent: </b>Sunday, September 22, 2024 9:01:47 PM<br><b>Subject: </b>Range API<o:p></o:p></span></p></blockquote></div><div><blockquote style='border:none;border-left:solid #1010FF 1.0pt;padding:0cm 0cm 0cm 2.0pt;margin-left:1.65pt;margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span style='font-family:"Helvetica","sans-serif";color:black'>Hello everyone! I am writing here today to invite everyone to participate in the discussion regarding the Range APi proposal I have made into JDK. Here is the pull request link: <a href="https://github.com/openjdk/jdk/pull/21122" target="_blank">https://github.com/openjdk/jdk/pull/21122</a>, and PR text:<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-family:"Helvetica","sans-serif";color:black'><br><br><o:p></o:p></span></p><p style='margin-top:0cm'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>This pull request describes the methods of the </span><code><span style='font-size:4.0pt;color:black;background:white'>Range<T></span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> interface. The </span><code><span style='font-size:4.0pt;color:black;background:white'>Range<T></span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> interface represents a bounded or unbounded range. (From now on, range, span and interval are used interchangeably, but docs only use "range")</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Goals:</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l28 level1 lfo1;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Main goal. Standardization of the Range/Interval API:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> The primary objective of this effort is to provide a standardized interface for working with ranges or spans of time (or any ordered types). Many existing libraries offer their own custom implementations of ranges, and they differ in significant ways, making it harder to use and combine across different codebases. Standardization will ensure consistency, interoperability, and a more predictable interface across various contexts.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l28 level1 lfo1;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Versatile range operations:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> provide a comprehensive API for manipulating and querying ranges, especially those representing time periods or numerical intervals. The API simplifies common tasks like checking containment, overlaps, or adjacency between ranges.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l28 level1 lfo1;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Support for unbounded ranges:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> Unlike many existing libraries, which assume intervals are always bounded, this API aims to fully support unbounded intervals. Users will be able to define ranges with open starts or ends, making it suitable for temporal data that spans indefinitely in one direction, such as future projections or historical data with unknown starting points.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l28 level1 lfo1;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Performance efficiency:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> The API aims to provide optimized for performance implementation, that takes advantage of all possible simplifications and short-circuits.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l28 level1 lfo1;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Consistency with existing libraries:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> To aid adoption, the API should be familiar to developers who have used popular libraries like NodaTime, Joda-Time, Three-Ten Extra, and Boost Date_Time, but with enhancements for unbounded intervals, negative ranges (?), and optional return types instead of null values.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Non-Goals:</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l12 level1 lfo2;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Handling complex data structures beyond smple ranges:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> This API is not intended to manage or represent complex data structures beyond ranges. For example, ranges that involve intricate internal states, like non-contiguous ranges (?) or ranges with multiple gaps, are out of scope.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l12 level1 lfo2;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Overly simplifying range types:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> While ease of use is a goal, its is not an aim to remove support for advanced cases like unbounded or negative ranges, even if this results in slightly more complex implementations. The API should not be skewed towards being purely a simple data structure for bounded ranges.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l12 level1 lfo2;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Application-specific logic:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> The API is meant to be domain-agnostic and general-purpose. It is not intended to allow to embed application-specific logic, such as calendar-based date manipulations or domain-specific business rules for interval comparison.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l12 level1 lfo2;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Replacing existing libraries:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> The goal is not to replace established libraries like Joda-Time or ThreeTen-Extra, but rather to augment these ideas with support for unbounded ranges and additional arithmetic operations. Although, it is a goal to provide interface that could exisiting libraries could easily retrofit into.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Motivation</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>The primary motivation behind standardizing the </span><code><span style='font-size:4.0pt;color:black;background:white'>Range</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> API is the <strong><span style='font-family:"Segoe UI","sans-serif"'>lack of an established, universal interface</span></strong> for handling ranges or spans across various domains. Developers are often forced to work with different, incompatible range implementations across libraries or to re-implement common functionality themselves. This leads to redundant code, increased dependencies, and greater chances for errors.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>In many software systems—whether in scheduling, auditing, access control, or financial services—ranges are used to represent periods of time, numerical intervals, or validity spans. Without a standardized API, developers must contend with diverse implementations that often differ in naming conventions, behavior, and supported features. These variations create unnecessary complexity, as developers must:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l27 level1 lfo3;box-sizing:border-box'><![if !supportLists]><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Introduce additional dependencies</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>: Many libraries provide similar functionality for ranges, but since they are not interchangeable, developers must often add extra dependencies to cover edge cases or specific use cases that are not available in a single library. This bloats the codebase and creates maintenance overhead.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l27 level1 lfo3;box-sizing:border-box'><![if !supportLists]><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Re-implement common logic</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>: In cases where no single library meets the required needs, developers are forced to write their own range-handling logic. This reinvention of basic operations such as intersection, union, or containment leads to redundancy, increased likelihood of bugs, and inconsistency in how ranges are handled across different parts of the code.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l27 level1 lfo3;box-sizing:border-box'><![if !supportLists]><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><span style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Fragmentation across domains</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>: Different libraries often define their own range concepts (e.g., for date-times, numbers, or general comparisons), which are rarely compatible with one another. This lack of compatibility makes integration between systems difficult, requiring custom adapters or conversions.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>By defining a standard </span><code><span style='font-size:4.0pt;color:black;background:white'>Range</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> API, the goal is to:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l26 level1 lfo4;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Reduce the dependency footprint:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> A common, well-designed API for ranges would eliminate the need to import multiple libraries just to handle different types of ranges, reducing dependencies in projects and enhancing maintainability.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l26 level1 lfo4;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Simplify code and increase reusability:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> With a standardized interface, developers can write range-related code once and reuse it across projects and libraries, confident that the same semantics and operations will apply consistently.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l26 level1 lfo4;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Minimize developer errors:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> By providing a predictable and well-documented interface, the likelihood of misunderstandings or incorrect use of range operations will decrease. Developers can trust that operations like intersections, unions, and comparisons will behave consistently, regardless of the context.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>In essence, the lack of standardization in range operations creates unnecessary complexity, fragmentation, and redundant effort. A standardized </span><code><span style='font-size:4.0pt;color:black;background:white'>Range</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> API would provide clarity, reduce the need for additional dependencies, and enable more efficient, reusable, and error-free code across different projects and domains.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h1 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>Key API points</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h1><h2 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>Support of unbounded intervals</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h2><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>API supports both one- and two-sided. Provided sample (draft) implementation for</span><code><span style='font-size:4.0pt;color:black;background:white'> ChronoDateTime</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> has 4 separate implementation for each type of ranges.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l16 level1 lfo5;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Many Libraries, like Luxon, C++ boost, NodaTime and many others, arguably the most, fo not explicitly support unbounded intervals. This reduces complexity of implementation, but takes away many possible optimization for edge-cases. Alternative they propose is to use Instant.MIN and Instant.MAX or similar to create unbounded-like intervals.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><h2 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>Support for negative intervals,</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h2><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>API supports both positive and negative and positive ranges. This is questionable and discussion is encouraged.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Advantages</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l6 level1 lfo6;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Allows more flexible usage of API, which would be helpful for use cases like diagrams visualization.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Disadvantages</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo7;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Dramatically increases amount of boilerplate code inside the implementations.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo7;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Makes behaviour of potential methods like </span><code><span style='font-size:4.0pt;background:white'>boolean endsBefore(T t) </span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>unintuitive. Does this mean that end() is before that provided parameter, or latter of bounds (i.e. </span><code><span style='font-size:4.0pt;background:white'>start()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> for negative range and </span><code><span style='font-size:4.0pt;background:white'>end()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> for positive).</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo7;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Limited usability scope. Most use cases would not benefit from possibility of negative ranges creation, but would have to suffer performance decrease.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>In general, either there should be support for negative ranges, or ranges might be end-exclusve, but not two at the same time, as having them both together dramatically increases complexity.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h2 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>Range</span></code><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'> is not </span><code><span style='font-size:10.0pt;color:black;background:white'>Serializable</span></code><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h2><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Currently ranges are not</span><code><span style='font-size:4.0pt;color:black;background:white'> Serializable</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>. This is due to difficulties regarding using non-serializable interfaces, like </span><code><span style='font-size:4.0pt;color:black;background:white'>ChronoDateTIme </span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> in sample implementation.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l11 level1 lfo8;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Restrict range type variable to implement </span><code><span style='font-size:4.0pt;background:white'>Serializable</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>. I see this option as undesiarable bacause of how much it narrows use of interface.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><h2 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>Current interface methods list is minimal</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h2><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>For now, API proposed contains minimal amount of methods that are used in range arithmetics. List of methods is supposed to change as discussion moves on.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h2 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>Generic Range class vs Rnage interface + specific inmplementations</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h2><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Currently, approach is to define interface and list of implementations.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Advantages</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l13 level1 lfo9;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Ability to introduce specialized for type of range methods. For example, </span><code><span style='font-size:4.0pt;background:white'>Timespan</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> could have </span><code><span style='font-size:4.0pt;background:white'>Duration toDuration()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> method, potential </span><code><span style='font-size:4.0pt;background:white'>IntegerRange</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> could have something like </span><code><span style='font-size:4.0pt;background:white'>LongRange toLongRange()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> dur to limitations of comparability between classes. This would be impossible with structural class Range without declaring additional static utility methods.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l13 level1 lfo9;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Enhanced validation of annotaion targets as classes, unlike generics, arent erased.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Disadvantages</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l24 level1 lfo10;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Increased amount of classes to maintain.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l24 level1 lfo10;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Additional considerations would be required before extending Range interface in case if hierarchy non-sealed to ensure backward compatibility.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><h1 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>API Description</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h1><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>NB: Since date ranges is supposed to be one of the most popular if not the most popular use case for range, date-time libraries were main reference for interface design.</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h2 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>Section: Bounds</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h2><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>General notes</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l17 level1 lfo11;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>In <strong><span style='font-family:"Segoe UI","sans-serif"'>Boost Date_Time</span></strong> (</span><code><span style='font-size:4.0pt;background:white'>time_period.begin()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>), the start and end are always defined, meaning there is no concept of unbounded intervals. Similarly, some libraries like <strong><span style='font-family:"Segoe UI","sans-serif"'>Chrono</span></strong> in Rust assume bounded intervals by default. In fact, only a few libraries expose trully unbound ranges. Although, while complexity of implementation is increased by this corner cases, thier performance also vastly increased by cutting amount of operations in each method at least in half (For two-way unbound interval, almost all operations return constnat value).</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>T start()</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'><br>Returns the start of the range. If the range is unbounded at the start, this method throws an </span><code><span style='font-size:4.0pt;color:black;background:white'>UnsupportedOperationException</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>. This can be preemptively checked using </span><code><span style='font-size:4.0pt;color:black;background:white'>isBoundedAtStart()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l33 level1 lfo12;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Method could return </span><code><span style='font-size:4.0pt;background:white'>Optional<T></span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> instead of throwing an exception. I see this two approaches roughly identical in terms of pros/cons score, so suggestions are much appreciated.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>T end()</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns the end of the range. If the range is unbounded at the end, this method throws an </span><code><span style='font-size:4.0pt;color:black;background:white'>UnsupportedOperationException</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>. Use </span><code><span style='font-size:4.0pt;color:black;background:white'>isBoundedAtEnd()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> to check if the range is bounded.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l8 level1 lfo13;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Simallarly to start(), method could return </span><code><span style='font-size:4.0pt;background:white'>Optional<T></span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> instead of throwing an exception. I see this two approaches roughly identical in terms of pros/cons score, so suggestions are much appreciated.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean isBoundedAtStart()</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns </span><code><span style='font-size:4.0pt;color:black;background:white'>true</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> if the range is bounded at the start. If unbounded, it returns </span><code><span style='font-size:4.0pt;color:black;background:white'>false</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>, meaning calling </span><code><span style='font-size:4.0pt;color:black;background:white'>start()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> will throw an </span><code><span style='font-size:4.0pt;color:black;background:white'>UnsupportedOperationException</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo14;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Joda-Time</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>, <strong><span style='font-family:"Segoe UI","sans-serif"'>NodaTime</span></strong>, <strong><span style='font-family:"Segoe UI","sans-serif"'>Luxon</span></strong>, and <strong><span style='font-family:"Segoe UI","sans-serif"'>Moment.js</span></strong> do not explicitly support unbounded intervals by default but can use </span><code><span style='font-size:4.0pt;background:white'>null</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> or special values to represent unbounded starts.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo14;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Boost Date_Time</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> and <strong><span style='font-family:"Segoe UI","sans-serif"'>Chrono</span></strong> don’t support unbounded ranges directly, so this method is unnecessary.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean isBoundedAtEnd()</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns </span><code><span style='font-size:4.0pt;color:black;background:white'>true</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> if the range is bounded at the end. A false value means the range is unbounded at the end, and calling </span><code><span style='font-size:4.0pt;color:black;background:white'>end()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> will throw an </span><code><span style='font-size:4.0pt;color:black;background:white'>UnsupportedOperationException</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l19 level1 lfo15;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Similar to </span><code><span style='font-size:4.0pt;background:white'>isBoundedAtStart()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>, most libraries don’t have built-in unbounded intervals, but the concept can be simulated using </span><code><span style='font-size:4.0pt;background:white'>null</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>, minimal/maximal possible value etc. Pros and cons were described in API notes.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h2 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>Section: boolean operations</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h2><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean contains(T instant)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns </span><code><span style='font-size:4.0pt;color:black;background:white'>true</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> if the given </span><code><span style='font-size:4.0pt;color:black;background:white'>instant</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> falls within the start and end bounds of the range, otherwise returns </span><code><span style='font-size:4.0pt;color:black;background:white'>false</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Similar Methods in other libraries</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l9 level1 lfo16;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>NodaTime (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.Contains</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l9 level1 lfo16;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Joda-Time (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.contains</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l9 level1 lfo16;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Luxon (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.contains</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l9 level1 lfo16;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Boost Date_Time (</span></strong><code><b><span style='font-size:4.0pt;background:white'>time_period.contains()</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l9 level1 lfo16;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>And many others...</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Differences with existing APIs</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l5 level1 lfo17;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Moment.js</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> doesn’t provide a direct </span><code><span style='font-size:4.0pt;background:white'>contains</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> method but the </span><code><span style='font-size:4.0pt;background:white'>moment-range</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> plugin adds this functionality with </span><code><span style='font-size:4.0pt;background:white'>range.contains()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Note</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>: this method is present in most interval implementations. Terefore, I concider as basic and unremovable from the API.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean overlaps(Range<? extends T> other)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Checks if the current range overlaps with another range. Returns </span><code><span style='font-size:4.0pt;color:black;background:white'>true</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> if the two ranges overlap, otherwise returns </span><code><span style='font-size:4.0pt;color:black;background:white'>false</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Similar Methods in other libraries</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l2 level1 lfo18;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>NodaTime (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.Overlaps</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l2 level1 lfo18;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Joda-Time (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.overlaps</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l2 level1 lfo18;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Luxon (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.overlaps</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l2 level1 lfo18;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Boost Date_Time (</span></strong><code><b><span style='font-size:4.0pt;background:white'>time_period.intersects()</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l2 level1 lfo18;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>And many others...</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Differences with existing APIs</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l10 level1 lfo19;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Moment.js</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>: The </span><code><span style='font-size:4.0pt;background:white'>moment-range</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> plugin provides a similar </span><code><span style='font-size:4.0pt;background:white'>overlaps()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> method to check overlap.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l10 level1 lfo19;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Chrono</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> relies on custom interval intersection logic.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Note</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>: this method is present in most interval implementations. Terefore, I concider as basic and unremovable from the API.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>General notes on next two methods</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Most of the libraries propose API like </span><code><span style='font-size:4.0pt;color:black;background:white'>isBefore(T point)</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> or do not provide methods like this at all. Since current implementation throws an exception if interval is not bounded, trivial check for </span><code><span style='font-size:4.0pt;color:black;background:white'>isBefore</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> could become 4-6 lines long. The question basically comes down to whether the Range class should be more data-structure-like or object-like. I would argue that at least </span><code><span style='font-size:4.0pt;color:black;background:white'>isBefore(T moment)</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> is required, especially since ranges can be negative currently. Existence of boolean isBefore(Range<? extends T> other)</span><code><span style='font-size:4.0pt;color:black;background:white'>and similar</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>isAfter` is up to discussion.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean isBefore(Range<? extends T> other)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns </span><code><span style='font-size:4.0pt;color:black;background:white'>true</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> if the current range is strictly before another range (i.e., ends before the other range starts).</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Differences with other libraries</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l7 level1 lfo20;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>NodaTime</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>: You’d manually compare </span><code><span style='font-size:4.0pt;background:white'>End</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> of one interval with the </span><code><span style='font-size:4.0pt;background:white'>Start</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> of another.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l7 level1 lfo20;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Joda-Time</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>: Manual comparison with </span><code><span style='font-size:4.0pt;background:white'>Interval.getEnd()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> and </span><code><span style='font-size:4.0pt;background:white'>Interval.getStart()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l7 level1 lfo20;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Boost Date_Time</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> and <strong><span style='font-family:"Segoe UI","sans-serif"'>Chrono</span></strong> would use custom logic to compare </span><code><span style='font-size:4.0pt;background:white'>time_period</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> or ranges of time, since they don’t have a direct equivalent of </span><code><span style='font-size:4.0pt;background:white'>isBefore()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l29 level1 lfo21;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Most of the libraries propose API like </span><code><span style='font-size:4.0pt;background:white'>isBefore(T point)</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> or do not provide methods like this at all. Since current implementation throws an exception if interval is not bounded, trivial check for </span><code><span style='font-size:4.0pt;background:white'>isBefore</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> could become 4-6 lines long. The question basically comes down to whether the Range class should be more data-structure-like or object-like. I would argue that at least </span><code><span style='font-size:4.0pt;background:white'>isBefore(T moment)</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> is required, especially since ranges can be negative currently</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean isAfter(Range<? extends T> other)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns </span><code><span style='font-size:4.0pt;color:black;background:white'>true</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> if the current range is strictly after another range (i.e., starts after the other range ends).</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l31 level1 lfo22;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Similar Methods</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><ul type=disc><ul type=circle><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l31 level2 lfo22;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Similar to </span><code><span style='font-size:4.0pt;background:white'>isBefore()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>, manual comparisons are used in <strong><span style='font-family:"Segoe UI","sans-serif"'>NodaTime</span></strong>, <strong><span style='font-family:"Segoe UI","sans-serif"'>Joda-Time</span></strong>, and <strong><span style='font-family:"Segoe UI","sans-serif"'>Luxon</span></strong> an others.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean isBefore(T point)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'><br>Determines if the span ends before the given point. This is useful when you need to check whether a time span occurs entirely before a specific point.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l3 level1 lfo23;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Method could be removed from APi at all, if Range is desired to be skewed towards being data structure.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean isAfter(T point)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'><br>Determines if the span starts after the given point. This is useful when you need to check whether a time span occurs entirely after a specific point.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l25 level1 lfo24;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Similarly to </span><code><span style='font-size:4.0pt;background:white'>boolean isBefore(T point)</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>, method could be removed from APi at all, if Range is desired to be skewed towards being data structure.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean isNegative()</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns </span><code><span style='font-size:4.0pt;color:black;background:white'>true</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> if the start of the range is after the end, indicating a "negative" range.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l20 level1 lfo25;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>if concidered too niche, negatie timespans could be removed from model.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Note:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> this one is most questionable for me. Do we really need negative ranges? This is most entirely required in numeric ranges and diagrams, while introdcues huge complexity overhead for majority that doesnt need this feature. Negativity might be confusing for users. Would love to hear thoughs on this matter</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h2 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>Section: Range arithmetics</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h2><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>Optional<Range<T>> intersection(Range<? extends T> other)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns the intersection of the current range with another range. If the ranges do not overlap, the result is an empty </span><code><span style='font-size:4.0pt;color:black;background:white'>Optional</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>. If they overlap, the intersection is returned.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Similar Methods</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l23 level1 lfo26;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>NodaTime (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.Intersection()</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l23 level1 lfo26;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Moment.js (via </span></strong><code><b><span style='font-size:4.0pt;background:white'>moment-range</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>, </span></strong><code><b><span style='font-size:4.0pt;background:white'>range.intersect()</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l23 level1 lfo26;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Joda-Time (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.overlap()</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l23 level1 lfo26;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>And many others...</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Differences with existing APIs</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l18 level1 lfo27;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Boost Date_Time</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> returns an empty </span><code><span style='font-size:4.0pt;background:white'>time_period</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> if no overlap exists, instead of an </span><code><span style='font-size:4.0pt;background:white'>Optional</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>. Some libraries return </span><code><span style='font-size:4.0pt;background:white'>null</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> (e.g., <strong><span style='font-family:"Segoe UI","sans-serif"'>NodaTime</span></strong>).</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l18 level1 lfo27;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Other libraries return null if intervals arent overlapping. This is undesrable, so optional returned instead.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Note</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>: this method is present in most interval implementations. Terefore, I concider as basic and unremovable from the API.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>Range<T>[] union(Range<? extends T> other)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns the union of two ranges. If the ranges overlap, the result is a single combined range. If they do not overlap, the result is an array of two separate ranges.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Differences with existing APIs</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l21 level1 lfo28;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>NodaTime</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> and <strong><span style='font-family:"Segoe UI","sans-serif"'>Joda-Time</span></strong> support similar logic using custom union handling.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l21 level1 lfo28;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Boost Date_Time</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> has no built-in </span><code><span style='font-size:4.0pt;background:white'>union()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> function but you can write custom logic to combine or separate intervals.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Note</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>: Behaviour of this method is up to change. Currently, it returns array for maximal performance, but it can (and most likely should) be wrapped in some monadic class. As an alternative, there may be support for non-continuous ranges (ones with gaps inside them), then this method should return thise kind of range.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>Optional<Range<T>> gap(Range<? extends T> other)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns the gap between two ranges, if they do not overlap. If they overlap, the result is an empty </span><code><span style='font-size:4.0pt;color:black;background:white'>Optional</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Differences with existing APIs</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l14 level1 lfo29;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>NodaTime</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> and <strong><span style='font-family:"Segoe UI","sans-serif"'>Joda-Time</span></strong> support custom logic to calculate the gap using </span><code><span style='font-size:4.0pt;background:white'>isBefore()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>, </span><code><span style='font-size:4.0pt;background:white'>isAfter()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>, and manual calculations of the gap.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;margin-top:3.0pt;mso-margin-bottom-alt:auto;mso-list:l14 level1 lfo29;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Other libraries return null if intervals are overlapping. This is undesrable, so optional returned instead.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h2 style='box-sizing:border-box'><span style='font-family:"Segoe UI","sans-serif";color:black;background:white'>Section: potential methods</span><span style='font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h2><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean isEmpty()</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description:</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'><br>Determines if the range is "empty,"</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Empty range is its own, separate type of range (basically opposite of unbounded range). There are many questions regrading this type of range. Is it bounded at start or end? If so, what should </span><code><span style='font-size:4.0pt;color:black;background:white'>start()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> or </span><code><span style='font-size:4.0pt;color:black;background:white'>end()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> return. Them throwing an exception would violate current contract between </span><code><span style='font-size:4.0pt;color:black;background:white'>IsBoundedAtX()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> and 'x()` methods.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Advantages</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l32 level1 lfo30;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Returning empty range instead of Optional might be more user-friendly</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Disadvantages</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l22 level1 lfo31;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>One more concept in the API model</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l22 level1 lfo31;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Corner case in </span><code><span style='font-size:4.0pt;background:white'>IsBoundedAtX()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> and 'x()` contract.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul><h3 style='box-sizing:border-box'><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Potential Methods for API Enhancement</span><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>In this section, we explore methods that could be added to the API, comparing them with similar functionality in popular time-related libraries. These methods enhance the versatility and clarity of the </span><code><span style='font-size:4.0pt;color:black;background:white'>Range<T></span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> implementation, especially in the context of temporal, numeric, and other domain-specific ranges. Some of these methods are inspired by well-established libraries, while others are novel suggestions.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean encloses(Range<? extends T> other)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Checks whether the current range completely encloses another range, i.e., the other range starts after or at the start of the current range and ends before or at the end of the current range.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l4 level1 lfo32;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Similar Methods in Other Libraries</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><ul type=circle><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l4 level2 lfo32;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>NodaTime (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.ContainedBy</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l4 level2 lfo32;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Joda-Time (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.contains</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l4 level2 lfo32;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Luxon (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.contains</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l4 level2 lfo32;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Boost Date_Time (</span></strong><code><b><span style='font-size:4.0pt;background:white'>time_period.contains()</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul></ul><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l4 level1 lfo32;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Differences with Existing APIs</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><ul type=circle><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l4 level2 lfo32;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Some libraries handle </span><code><span style='font-size:4.0pt;background:white'>encloses()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> and </span><code><span style='font-size:4.0pt;background:white'>contains()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> in the same method. For clarity, this API can separate the two, where </span><code><span style='font-size:4.0pt;background:white'>contains()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> is used for checking individual points and </span><code><span style='font-size:4.0pt;background:white'>encloses()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> is for range-level comparison.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>boolean abuts(Range<? extends T> other)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns </span><code><span style='font-size:4.0pt;color:black;background:white'>true</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'> if the current range abuts (i.e., touches but does not overlap) with another range. This method is useful when determining whether two ranges are adjacent but do not overlap.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l15 level1 lfo33;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Similar Methods in Other Libraries</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><ul type=circle><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l15 level2 lfo33;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>NodaTime (</span></strong><code><b><span style='font-size:4.0pt;background:white'>Interval.Abuts</span></b></code><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>)</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul></ul><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l15 level1 lfo33;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Alternatives</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><ul type=circle><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l15 level2 lfo33;box-sizing:border-box'><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Instead of this method, users could manually compare the </span><code><span style='font-size:4.0pt;background:white'>end</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> of one range and the </span><code><span style='font-size:4.0pt;background:white'>start</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> of another, but including </span><code><span style='font-size:4.0pt;background:white'>abuts()</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> in the API simplifies the logic and reduces error-prone comparisons.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul></ul><div class=MsoNormal align=center style='text-align:center'><span style='font-family:"Helvetica","sans-serif";color:black'><hr size=9 width="100%" align=center></span></div><h3 style='box-sizing:border-box'><code><span style='font-size:10.0pt;color:black;background:white'>Range<T> extendTo(T point)</span></code><span style='font-size:15.0pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></h3><p style='margin-top:0cm;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Description</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:<br>Returns a new range that extends the current range to include the given point. If the point is already within the range, it returns the current range. Otherwise, it extends either the start or end, depending on the point's position relative to the range.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><p style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l30 level1 lfo34;box-sizing:border-box'><![if !supportLists]><span style='font-size:10.0pt;font-family:Symbol;color:black'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>        </span></span></span><![endif]><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>Similar Methods in Other Libraries</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black;background:white'>:</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";color:black'><o:p></o:p></span></p><ul type=disc><ul type=circle><li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l30 level2 lfo34;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>NodaTime</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'> and <strong><span style='font-family:"Segoe UI","sans-serif"'>Joda-Time</span></strong> do not have explicit methods for this, but users can manipulate intervals manually.</span><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li><li class=MsoNormal style='color:black;mso-margin-bottom-alt:auto;mso-list:l30 level2 lfo34;box-sizing:border-box'><strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>Moment.js</span></strong><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif";background:white'>: The </span><code><span style='font-size:4.0pt;background:white'>moment-ran</span></code><span style='font-size:4.5pt;font-family:"Segoe UI","sans-serif"'><o:p></o:p></span></li></ul></ul></div></div></blockquote></div></div></div></blockquote></div></div></body></html>