@Test public void map() throws Exception { Range<Days> r = five.map(d->Days.values()[d],days.enumeration(), Comparators.naturalOrderIdentityComparator()); assertThat(r.start,equalTo(Days.Tuesday)); assertThat(r.end,equalTo(Days.Saturday)); }
public <R> Range<R> map(Function<? super T,? extends R> fn, Enumeration<R> enm, Comparator<? super R> comp){ R s2 = fn.apply(start); R e2 = fn.apply(end); return Ordering.of(comp).isLessThanOrEqual(s2,e2)? range( s2,e2,enm,comp) : range(e2,s2,enm,comp); }
Range implements Iterable<T>, Higher<range,T>, Serializable { public <R> Range<R> map(Function<? super T,? extends R> fn, Enumeration<R> enm, Comparator<? super R> comp){ R s2 = fn.apply(start); R e2 = fn.apply(end); return Ordering.of(comp).isLessThanOrEqual(s2,e2)? range( s2,e2,enm,comp) : range(e2,s2,enm,comp); } }
Range implements Iterable<T>, Higher<range,T>, Serializable { public <R> Range<R> map(Function<? super T,? extends R> fn, Enumeration<R> enm, Comparator<? super R> comp){ R s2 = fn.apply(start); R e2 = fn.apply(end); return Ordering.of(comp).isLessThanOrEqual(s2,e2)? range( s2,e2,enm,comp) : range(e2,s2,enm,comp); }  }
Range implements Iterable<T>, Higher<range,T>, Serializable { public <R> Range<R> map(Function<? super T,? extends R> fn, Enumeration<R> enm, Comparator<? super R> comp){ R s2 = fn.apply(start); R e2 = fn.apply(end); return Ordering.of(comp).isLessThanOrEqual(s2,e2)? range( s2,e2,enm,comp) : range(e2,s2,enm,comp); }  static Range<T> range(T start, T end, Enumeration<T> enm, Comparator<? super T> comp); static Range<T> range(T start, T end, Enumeration<T> enm); static Range<Integer> range(int start,int end); Enumeration<T> enumeration(); boolean startsBefore(Range<T> r); boolean endsAfter(Range<T> r); Range<R> map(Function<? super T,? extends R> fn, Enumeration<R> enm, Comparator<? super R> comp); Ordering<? super T> ordering(); Range<T> reverse(); boolean contains(T value); boolean contains(Range<T> compareTo); Tuple2<Range<T>,Option<Range<T>>> plusAll(Range<T> range); Option<Tuple2<Range<T>,Option<Range<T>>>> minusAll(Range<T> range); Option<Range<T>> intersection(Range<T> toMerge); ReactiveSeq<T> stream(); LazySeq<T> lazySeq(); @Override String toString(); String allToString(); @Override Iterator<T> iterator(); }
Range implements Iterable<T>, Higher<range,T>, Serializable { public <R> Range<R> map(Function<? super T,? extends R> fn, Enumeration<R> enm, Comparator<? super R> comp){ R s2 = fn.apply(start); R e2 = fn.apply(end); return Ordering.of(comp).isLessThanOrEqual(s2,e2)? range( s2,e2,enm,comp) : range(e2,s2,enm,comp); }  static Range<T> range(T start, T end, Enumeration<T> enm, Comparator<? super T> comp); static Range<T> range(T start, T end, Enumeration<T> enm); static Range<Integer> range(int start,int end); Enumeration<T> enumeration(); boolean startsBefore(Range<T> r); boolean endsAfter(Range<T> r); Range<R> map(Function<? super T,? extends R> fn, Enumeration<R> enm, Comparator<? super R> comp); Ordering<? super T> ordering(); Range<T> reverse(); boolean contains(T value); boolean contains(Range<T> compareTo); Tuple2<Range<T>,Option<Range<T>>> plusAll(Range<T> range); Option<Tuple2<Range<T>,Option<Range<T>>>> minusAll(Range<T> range); Option<Range<T>> intersection(Range<T> toMerge); ReactiveSeq<T> stream(); LazySeq<T> lazySeq(); @Override String toString(); String allToString(); @Override Iterator<T> iterator(); final T start; final T end; }