Attributes | |
duration | Source Codeshared formal Duration duration Returns the Duration between from and to fields. Example: Given: today().to(tomorrow).duration then duration is 86400000 milliseconds. Given: tomorrow().to(today).duration then duration is -86400000 milliseconds. |
from | Source Codeshared formal Element from The first Element returned by the iterator, if any.
This should always produce the same value as
Example: today().to(tomorrow) -> in this case today() is the caller/creator of the range. |
hash | Source Codeshared actual default Integer hash This implementation respect the constraint that if Refines Object.hash |
period | Source Codeshared formal Period period Returns the Period between from and to fields. Example: Given: today().to(tomorrow).duration then duration is 1 day. Given: tomorrow().to(today).duration then duration is -1 day. |
step | Source Codeshared formal UnitOfDate|UnitOfTime step Customized way to iterate over each element, it does not interfer in from and to fields, but it does not guarantee that to will be included in iterator. |
string | Source Codeshared actual default String string Returns ISO-8601 formatted String representation of this Range. Reference: https://en.wikipedia.org/wiki/ISO_8601#Time_intervals |
to | Source Codeshared formal Element to The limit of the Range where. Example: Given: today().to(tomorrow) then tomorrow is the to element. Given: tomorrow.to(today()) then today() is the to element. |
Inherited Attributes |
Attributes inherited from: Iterable<Element,Absent> |
Methods | |
equals | Source Codeshared actual default Boolean equals(Object other) Returns true if both: this and other are same type and have equal fields from and to. Refines Object.equals |
gap | Source Codeshared formal Range<Element,StepBy>|[] gap(Range<Element,StepBy> other) Returns empty or a new Range:
Given: [A..B] gap [C..D] When: AB < CD [1..2] gap [5..6] = (2,5) [1..2] gap [6..5] = (2,5) [2..1] gap [5..6] = (2,5) [2..1] gap [6..5] = (2,5) Given: [A..B] gap [C..D] When: AB > CD [5..6] gap [1..2] = (2,5) [5..6] gap [2..1] = (2,5) [6..5] gap [1..2] = (2,5) [6..5] gap [2..1] = (2,5) |
overlap | Source Codeshared formal Range<Element,StepBy>|[] overlap(Range<Element,StepBy> other) Returns empty or a new Range:
Given: [A..B] overlap [C..D] When: AB < CD [1..6] overlap [3..9] = [3,6] [1..6] overlap [9..3] = [3,6] [6..1] overlap [3..9] = [3,6] [6..1] overlap [9..3] = [3,6] Given: [A..B] overlap [C..D] When: AB > CD [3..9] overlap [1..6] = [3,6] [3..9] overlap [6..1] = [3,6] [9..3] overlap [1..6] = [3,6] [9..3] overlap [6..1] = [3,6] |
stepBy | Source Codeshared formal Range<Element,StepBy> stepBy(StepBy step) Define how this Range will get next or previous element while iterating. |
Inherited Methods |
Methods inherited from: Category<Element> |
Methods inherited from: Iterable<Element,Absent> Iterable.any() , Iterable.by() , Iterable.chain() , Iterable.collect() , Iterable.count() , Iterable.defaultNullElements() , Iterable.every() , Iterable.filter() , Iterable.find() , Iterable.findLast() , Iterable.flatMap() , Iterable.fold() , Iterable.follow() , Iterable.getFromFirst() , Iterable.interpose() , Iterable.iterator() , Iterable.longerThan() , Iterable.map() , Iterable.max() , Iterable.partition() , Iterable.product() , Iterable.reduce() , Iterable.repeat() , Iterable.scan() , Iterable.select() , Iterable.sequence() , Iterable.shorterThan() , Iterable.skip() , Iterable.skipWhile() , Iterable.sort() , Iterable.spread() , Iterable.take() , Iterable.takeWhile() |