Two Colored Array Range
TwoColoredRange implementation using ArrayList. It keeps list of subranges painted with defaultColor and calculates subranges of otherColor when required so requests related to defaultColor are more efficient than ones related to otherColor.
Inheritors
Constructors
Properties
the default color, a colored range is supposed to be fully colored with it right after constructor call.
the length of colored range.
the math used for calculating lengths and distances of subranges.
the second color.
a regular range marking bounds of colored range.
the factory for ranges, it is used for custom ranges type. For example IntRange is more convenient than ClosedRange<BoundType> for equality checks outside the interface or class.
the minimal non-zero length of a subrange and distance between two neighbour subranges. Usually it has a value of 1 for integer types of BoundType.
Functions
getSubrangeOfColor called with maxLength = step and limitByRange = range.
getSubrangeOfColor called with limitByRange = range.
getSubrangeOfColor called with maxLength = step.
Performs a search for a subrange with color color limited by limitByRange. If a subrange with length >= maxLength was found then returns a subrange from foundSubrange.start to foundSubrange.start + maxLength (involving math and rangeFactory). Otherwise returns first non-empty subrange with color color inside limitByRange or null.
Returns list of subranges colored with color.
Returns list of subranges colored with defaultColor.
Returns list of subranges colored with otherColor.
Iterator limited by limitByRange.