<div dir="ltr">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">https://github.com/openjdk/jdk/pull/21122</a>, and PR text:<div><br><p dir="auto" style="box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px;margin-top:0px"><span style="background-color:rgb(255,255,255)"><font color="#000000">This pull request describes the methods of the <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Range<T></code> interface. The <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Range<T></code> interface represents a bounded or unbounded range. (From now on, range, span and interval are used interchangeably, but docs only use "range")</font></span></p><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Goals:</font></span></h3><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Main goal. Standardization of the Range/Interval API:</strong> 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.</font></span></p></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Versatile range operations:</strong> 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.</font></span></p></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Support for unbounded ranges:</strong> 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.</font></span></p></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Performance efficiency:</strong> The API aims to provide optimized for performance implementation, that takes advantage of all possible simplifications and short-circuits.</font></span></p></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Consistency with existing libraries:</strong> 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.</font></span></p></li></ul><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Non-Goals:</font></span></h3><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Handling complex data structures beyond smple ranges:</strong> 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.</font></span></p></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Overly simplifying range types:</strong> 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.</font></span></p></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Application-specific logic:</strong> 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.</font></span></p></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Replacing existing libraries:</strong> 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.</font></span></p></li></ul><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Motivation</font></span></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">The primary motivation behind standardizing the <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Range</code> API is the <strong style="box-sizing:border-box">lack of an established, universal interface</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.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">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:</font></span></p><ol dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Introduce additional dependencies</strong>: 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.</font></span></p></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Re-implement common logic</strong>: 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.</font></span></p></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Fragmentation across domains</strong>: 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.</font></span></p></li></ol><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">By defining a standard <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Range</code> API, the goal is to:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Reduce the dependency footprint:</strong> 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.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Simplify code and increase reusability:</strong> 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.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Minimize developer errors:</strong> 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.</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">In essence, the lack of standardization in range operations creates unnecessary complexity, fragmentation, and redundant effort. A standardized <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Range</code> API would provide clarity, reduce the need for additional dependencies, and enable more efficient, reusable, and error-free code across different projects and domains.</font></span></p><h1 dir="auto" style="box-sizing:border-box;margin-right:0px;margin-left:0px;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Key API points</font></span></h1><h2 dir="auto" style="box-sizing:border-box;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Support of unbounded intervals</font></span></h2><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">API supports both one- and two-sided. Provided sample (draft) implementation for<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px"> ChronoDateTime</code> has 4 separate implementation for each type of ranges.</font></span></p><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Alternatives</font></span></h3><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">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.</font></span></li></ul><h2 dir="auto" style="box-sizing:border-box;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Support for negative intervals,</font></span></h2><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">API supports both positive and negative and positive ranges. This is questionable and discussion is encouraged.</font></span></p><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Advantages</font></span></h3><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Allows more flexible usage of API, which would be helpful for use cases like diagrams visualization.</font></span></li></ul><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Disadvantages</font></span></h3><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Dramatically increases amount of boilerplate code inside the implementations.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">Makes behaviour of potential methods like <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">boolean endsBefore(T t) </code>unintuitive. Does this mean that end() is before that provided parameter, or latter of bounds (i.e. <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">start()</code> for negative range and <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">end()</code> for positive).</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">Limited usability scope. Most use cases would not benefit from possibility of negative ranges creation, but would have to suffer performance decrease.</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">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.</font></span></p><h2 dir="auto" style="box-sizing:border-box;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000"><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px">Range</code> is not <code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px">Serializable</code></font></span></h2><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">Currently ranges are not<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px"> Serializable</code>. This is due to difficulties regarding using non-serializable interfaces, like <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">ChronoDateTIme </code> in sample implementation.</font></span></p><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Alternatives</font></span></h3><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Restrict range type variable to implement <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Serializable</code>. I see this option as undesiarable bacause of how much it narrows use of interface.</font></span></li></ul><h2 dir="auto" style="box-sizing:border-box;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Current interface methods list is minimal</font></span></h2><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">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.</font></span></p><h2 dir="auto" style="box-sizing:border-box;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Generic Range class vs Rnage interface + specific inmplementations</font></span></h2><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">Currently, approach is to define interface and list of implementations.</font></span></p><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Advantages</font></span></h3><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Ability to introduce specialized for type of range methods. For example, <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Timespan</code> could have <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Duration toDuration()</code> method, potential <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">IntegerRange</code> could have something like <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">LongRange toLongRange()</code> dur to limitations of comparability between classes. This would be impossible with structural class Range without declaring additional static utility methods.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">Enhanced validation of annotaion targets as classes, unlike generics, arent erased.</font></span></li></ul><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Disadvantages</font></span></h3><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Increased amount of classes to maintain.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">Additional considerations would be required before extending Range interface in case if hierarchy non-sealed to ensure backward compatibility.</font></span></li></ul><h1 dir="auto" style="box-sizing:border-box;margin-right:0px;margin-left:0px;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">API Description</font></span></h1><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">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.</font></span></h3><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h2 dir="auto" style="box-sizing:border-box;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Section: Bounds</font></span></h2><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">General notes</font></span></h3><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">In <strong style="box-sizing:border-box">Boost Date_Time</strong> (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">time_period.begin()</code>), the start and end are always defined, meaning there is no concept of unbounded intervals. Similarly, some libraries like <strong style="box-sizing:border-box">Chrono</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).</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">T start()</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description:</strong><br style="box-sizing:border-box">Returns the start of the range. If the range is unbounded at the start, this method throws an <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">UnsupportedOperationException</code>. This can be preemptively checked using <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBoundedAtStart()</code>.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Alternatives:</font></strong></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Method could return <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Optional<T></code> instead of throwing an exception. I see this two approaches roughly identical in terms of pros/cons score, so suggestions are much appreciated.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">T end()</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns the end of the range. If the range is unbounded at the end, this method throws an <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">UnsupportedOperationException</code>. Use <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBoundedAtEnd()</code> to check if the range is bounded.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Alternatives:</font></strong></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Simallarly to start(), method could return <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Optional<T></code> instead of throwing an exception. I see this two approaches roughly identical in terms of pros/cons score, so suggestions are much appreciated.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean isBoundedAtStart()</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">true</code> if the range is bounded at the start. If unbounded, it returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">false</code>, meaning calling <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">start()</code> will throw an <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">UnsupportedOperationException</code>.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Alternatives</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Joda-Time</strong>, <strong style="box-sizing:border-box">NodaTime</strong>, <strong style="box-sizing:border-box">Luxon</strong>, and <strong style="box-sizing:border-box">Moment.js</strong> do not explicitly support unbounded intervals by default but can use <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">null</code> or special values to represent unbounded starts.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Boost Date_Time</strong> and <strong style="box-sizing:border-box">Chrono</strong> don’t support unbounded ranges directly, so this method is unnecessary.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean isBoundedAtEnd()</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">true</code> if the range is bounded at the end. A false value means the range is unbounded at the end, and calling <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">end()</code> will throw an <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">UnsupportedOperationException</code>.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Alternatives</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Similar to <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBoundedAtStart()</code>, most libraries don’t have built-in unbounded intervals, but the concept can be simulated using <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">null</code>, minimal/maximal possible value etc. Pros and cons were described in API notes.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h2 dir="auto" style="box-sizing:border-box;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Section: boolean operations</font></span></h2><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean contains(T instant)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">true</code> if the given <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">instant</code> falls within the start and end bounds of the range, otherwise returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">false</code>.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Similar Methods in other libraries</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">NodaTime (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.Contains</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Joda-Time (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.contains</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Luxon (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.contains</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Boost Date_Time (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">time_period.contains()</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">And many others...</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Differences with existing APIs</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Moment.js</strong> doesn’t provide a direct <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">contains</code> method but the <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">moment-range</code> plugin adds this functionality with <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">range.contains()</code>.</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Note</strong>: this method is present in most interval implementations. Terefore, I concider as basic and unremovable from the API.</font></span></p><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean overlaps(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Checks if the current range overlaps with another range. Returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">true</code> if the two ranges overlap, otherwise returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">false</code>.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Similar Methods in other libraries</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">NodaTime (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.Overlaps</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Joda-Time (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.overlaps</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Luxon (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.overlaps</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Boost Date_Time (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">time_period.intersects()</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">And many others...</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Differences with existing APIs</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Moment.js</strong>: The <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">moment-range</code> plugin provides a similar <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">overlaps()</code> method to check overlap.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Chrono</strong> relies on custom interval intersection logic.</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Note</strong>: this method is present in most interval implementations. Terefore, I concider as basic and unremovable from the API.</font></span></p><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">General notes on next two methods</font></span></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">Most of the libraries propose API like <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBefore(T point)</code> or do not provide methods like this at all. Since current implementation throws an exception if interval is not bounded, trivial check for <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBefore</code> 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 <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBefore(T moment)</code> is required, especially since ranges can be negative currently. Existence of boolean isBefore(Range<? extends T> other)<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">and similar</code>isAfter` is up to discussion.</font></span></p><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean isBefore(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">true</code> if the current range is strictly before another range (i.e., ends before the other range starts).</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Differences with other libraries</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">NodaTime</strong>: You’d manually compare <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">End</code> of one interval with the <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Start</code> of another.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Joda-Time</strong>: Manual comparison with <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.getEnd()</code> and <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.getStart()</code>.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Boost Date_Time</strong> and <strong style="box-sizing:border-box">Chrono</strong> would use custom logic to compare <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">time_period</code> or ranges of time, since they don’t have a direct equivalent of <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBefore()</code>.</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Alternatives</font></strong></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Most of the libraries propose API like <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBefore(T point)</code> or do not provide methods like this at all. Since current implementation throws an exception if interval is not bounded, trivial check for <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBefore</code> 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 <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBefore(T moment)</code> is required, especially since ranges can be negative currently</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean isAfter(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">true</code> if the current range is strictly after another range (i.e., starts after the other range ends).</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Similar Methods</strong>:</font></span><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;margin-bottom:0px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Similar to <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBefore()</code>, manual comparisons are used in <strong style="box-sizing:border-box">NodaTime</strong>, <strong style="box-sizing:border-box">Joda-Time</strong>, and <strong style="box-sizing:border-box">Luxon</strong> an others.</font></span></li></ul></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean isBefore(T point)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description:</strong><br style="box-sizing:border-box">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.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Alternatives</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Method could be removed from APi at all, if Range is desired to be skewed towards being data structure.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean isAfter(T point)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description:</strong><br style="box-sizing:border-box">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.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Alternatives</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Similarly to <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">boolean isBefore(T point)</code>, method could be removed from APi at all, if Range is desired to be skewed towards being data structure.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean isNegative()</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">true</code> if the start of the range is after the end, indicating a "negative" range.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Alternatives:</font></strong></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">if concidered too niche, negatie timespans could be removed from model.</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Note:</strong> 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</font></span></p><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h2 dir="auto" style="box-sizing:border-box;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Section: Range arithmetics</font></span></h2><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Optional<Range<T>> intersection(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns the intersection of the current range with another range. If the ranges do not overlap, the result is an empty <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Optional</code>. If they overlap, the intersection is returned.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Similar Methods</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">NodaTime (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.Intersection()</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Moment.js (via <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">moment-range</code>, <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">range.intersect()</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Joda-Time (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.overlap()</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">And many others...</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Differences with existing APIs</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Boost Date_Time</strong> returns an empty <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">time_period</code> if no overlap exists, instead of an <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Optional</code>. Some libraries return <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">null</code> (e.g., <strong style="box-sizing:border-box">NodaTime</strong>).</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">Other libraries return null if intervals arent overlapping. This is undesrable, so optional returned instead.</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Note</strong>: this method is present in most interval implementations. Terefore, I concider as basic and unremovable from the API.</font></span></p><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Range<T>[] union(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">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.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Differences with existing APIs</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">NodaTime</strong> and <strong style="box-sizing:border-box">Joda-Time</strong> support similar logic using custom union handling.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Boost Date_Time</strong> has no built-in <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">union()</code> function but you can write custom logic to combine or separate intervals.</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Note</strong>: 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.</font></span></p><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Optional<Range<T>> gap(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns the gap between two ranges, if they do not overlap. If they overlap, the result is an empty <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Optional</code>.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Differences with existing APIs</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">NodaTime</strong> and <strong style="box-sizing:border-box">Joda-Time</strong> support custom logic to calculate the gap using <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBefore()</code>, <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isAfter()</code>, and manual calculations of the gap.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">Other libraries return null if intervals are overlapping. This is undesrable, so optional returned instead.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h2 dir="auto" style="box-sizing:border-box;line-height:1.25;padding-bottom:0.3em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Section: potential methods</font></span></h2><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean isEmpty()</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description:</strong><br style="box-sizing:border-box">Determines if the range is "empty,"</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">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 <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">start()</code> or <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">end()</code> return. Them throwing an exception would violate current contract between <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">IsBoundedAtX()</code> and 'x()` methods.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Advantages</font></strong></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Returning empty range instead of Optional might be more user-friendly</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Disadvantages</font></strong></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">One more concept in the API model</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">Corner case in <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">IsBoundedAtX()</code> and 'x()` contract.</font></span></li></ul><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><span style="background-color:rgb(255,255,255)"><font color="#000000">Potential Methods for API Enhancement</font></span></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000">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 <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Range<T></code> 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.</font></span></p><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean encloses(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">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.</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Similar Methods in Other Libraries</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;margin-bottom:0px"><li style="box-sizing:border-box"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">NodaTime (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.ContainedBy</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Joda-Time (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.contains</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Luxon (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.contains</code>)</font></strong></li><li style="box-sizing:border-box;margin-top:0.25em"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Boost Date_Time (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">time_period.contains()</code>)</font></strong></li></ul></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Differences with Existing APIs</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;margin-bottom:0px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Some libraries handle <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">encloses()</code> and <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">contains()</code> in the same method. For clarity, this API can separate the two, where <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">contains()</code> is used for checking individual points and <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">encloses()</code> is for range-level comparison.</font></span></li></ul></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean abuts(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">true</code> 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.</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Similar Methods in Other Libraries</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;margin-bottom:0px"><li style="box-sizing:border-box"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">NodaTime (<code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Interval.Abuts</code>)</font></strong></li></ul></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Alternatives</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;margin-bottom:0px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Instead of this method, users could manually compare the <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">end</code> of one range and the <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">start</code> of another, but including <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">abuts()</code> in the API simplifies the logic and reduces error-prone comparisons.</font></span></li></ul></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Range<T> extendTo(T point)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">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.</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Similar Methods in Other Libraries</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;margin-bottom:0px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">NodaTime</strong> and <strong style="box-sizing:border-box">Joda-Time</strong> do not have explicit methods for this, but users can manipulate intervals manually.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Moment.js</strong>: The <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">moment-range</code> plugin offers similar logic via manual adjustments to the range.</font></span></li></ul></li><li style="box-sizing:border-box;margin-top:0.25em"><p dir="auto" style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Advantages</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;margin-bottom:0px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">In contrast to manual adjustment, this method automates the process of extending ranges, which can be useful in situations where ranges need to be dynamically modified over time (e.g., expanding time intervals in streaming data).</font></span></li></ul></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Alternatives</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Users could manually adjust the range using <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">start()</code> and <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">end()</code> "withers", but an explicit <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">extendTo()</code> method offers a more intuitive, built-in approach</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Range<T> shrinkTo(T point)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns a new range that shrinks the current range to exclude the given point, if possible. If the point is within the range, the range is modified so that it no longer includes the point. This is useful for splitting ranges or excluding unwanted time periods or values.</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Similar Methods in Other Libraries</strong>:<br style="box-sizing:border-box">No major time libraries provide a direct equivalent to this functionality, although similar operations can be manually performed by manipulating <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">start</code> and <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">end</code>.</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Alternatives</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Similarly to <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">extendTo</code>, users could manually adjust the range using <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">start()</code> and <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">end()</code> "withers", but an explicit <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">shrinkTo()</code> method offers a more intuitive, built-in approach.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Range<T>[] difference(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns the difference between the current range and another range (XOR operations). If the ranges overlap, the result is a new range or two ranges representing the non-overlapping portions. If the ranges do not overlap, the result is the current range.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Adavntages</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">This method simplifies computing the difference between two ranges, reducing the need for manual boundary comparisons.</font></span></li><li style="box-sizing:border-box;margin-top:0.25em"><span style="background-color:rgb(255,255,255)"><font color="#000000">Completes set of methods required for ranges arithmetics</font></span></li></ul><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Disdavntages</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">THis method is inverse of <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">union(Range<? extends T> other)</code>, so it has same design problems as union.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Range<T> clamp(Range<? extends T> bounds)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Clamps the current range to fit within the specified bounds. If the current range extends outside of the bounds, it is shortened to fit within the bounds. If the range already fits within the bounds, it is returned unchanged.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Advantages</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">This method streamlines the process of adjusting a range to a set of bounds, which is especially useful in time-based operations where ranges must be constrained within specific periods (e.g., scheduling).</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">boolean isContiguousWith(Range<? extends T> other)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Determines if the current range is contiguous with another range, meaning that the two ranges touch or overlap without leaving any gaps. This is particularly useful when combining ranges or ensuring that a sequence of ranges forms a continuous block.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Alternatives</strong>:</font></span></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">Users could manually compare the <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">end</code> and <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">start</code> of ranges to check contiguity, but this method offers a more explicit and efficient way to perform the check.</font></span></li></ul><hr style="box-sizing:content-box;height:0.25em;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;border:0px;padding:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Optional<Range<T>> asBounded()</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Returns the bounded version of the current range, if one exists. If the range is already bounded, it returns the range unchanged. If the range is unbounded, the result is an empty <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Optional</code>. Could be used as a monade for handling errors if range that is expected to be bounded, but unbounded one has been recieved.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><strong style="box-sizing:border-box;background-color:rgb(255,255,255)"><font color="#000000">Alternatives:</font></strong></p><ul dir="auto" style="box-sizing:border-box;padding:0px;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><li style="box-sizing:border-box"><span style="background-color:rgb(255,255,255)"><font color="#000000">API could explicitly expose BoundedRange marker (or not marker) interface to verify range that is recieved is bounded at compile time. Interface could provide some adapter methods for converting unknown-boundness ranges to bounded, and have specific behaviour for error cases.</font></span></li></ul><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Range<T>[] splitAt(T point)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>: Splits the current range into two sub-ranges at the specified point. If the point lies outside the range, it returns an array of length 1 with initial range. If rang <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">contains()</code> point, than array of length 2 is returned, whith two ranges splitted accross given point.</font></span></p><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">List<Range<T>> splitInto(int n)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>:<br style="box-sizing:border-box">Splits the current range into <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">n</code> equal sub-ranges. If the range cannot be evenly divided, the last range may be slightly larger to accommodate the remaining span. Throws <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">UnsupportedOperationException</code> if range is at least half-unbounded.</font></span></p><h3 dir="auto" style="box-sizing:border-box;font-size:1.25em;line-height:1.25;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji""><code class="gmail-notranslate" style="box-sizing:border-box;font-size:inherit;padding:0px 0.2em;margin:0px;border-radius:6px;background-color:rgb(255,255,255)"><font color="#000000">Stream<T> pointsFromStartToEnd(??? step)</font></code></h3><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Description</strong>: Returns a list of points that are evenly spaced from the start to the end of the range, using the specified step size. Throws <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">UnsupportedOperationException</code> if range is <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">isBoundedAtStart()</code> returns false.</font></span></p><p dir="auto" style="box-sizing:border-box;margin-top:0px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><span style="background-color:rgb(255,255,255)"><font color="#000000"><strong style="box-sizing:border-box">Note:</strong> while this method could have various use cases, It is not clear how step could be provided. One of the options is to pass <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">Function<T, T></code> that is invoked on each value until value is <code class="gmail-notranslate" style="box-sizing:border-box;font-size:11.9px;padding:0.2em 0.4em;margin:0px;border-radius:6px">> end(</code>) instrad of constant step.</font></span></p></div></div>