Package nl.vpro.util

Class Ranges

java.lang.Object
nl.vpro.util.Ranges

public class Ranges extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <C extends Comparable<?>>
    com.google.common.collect.Range<C>
    closedClosed(@Nullable C start, @Nullable C stop)
    Creates on Range.closed(Comparable, Comparable) range, but the arguments can be null in which case unbounded ranges are created
    static <C extends Comparable<?>>
    com.google.common.collect.Range<C>
    closedOpen(@Nullable C start, @Nullable C stop)
    Creates on Range.openClosed(Comparable, Comparable) range, but the arguments can be null in which case unbounded ranges are created
    static <C extends Comparable<? super C>, D extends Comparable<? super D>>
    com.google.common.collect.Range<D>
    convert(com.google.common.collect.Range<C> in, Function<C,D> convertor)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • closedOpen

      public static <C extends Comparable<?>> com.google.common.collect.Range<C> closedOpen(@Nullable C start, @Nullable C stop)
      Creates on Range.openClosed(Comparable, Comparable) range, but the arguments can be null in which case unbounded ranges are created
      Throws:
      IllegalArgumentException - if lower is greater than upper
      Since:
      2.29.1
      See Also:
      • Range.closedOpen(Comparable, Comparable)
    • closedClosed

      public static <C extends Comparable<?>> com.google.common.collect.Range<C> closedClosed(@Nullable C start, @Nullable C stop)
      Creates on Range.closed(Comparable, Comparable) range, but the arguments can be null in which case unbounded ranges are created
      Throws:
      IllegalArgumentException - if lower is greater than upper
      Since:
      2.29.3
      See Also:
      • Range.closed(Comparable, Comparable)
    • convert

      public static <C extends Comparable<? super C>, D extends Comparable<? super D>> com.google.common.collect.Range<D> convert(com.google.common.collect.Range<C> in, Function<C,D> convertor)