Class IntervalSet.Builder<T extends java.lang.Comparable<T>>

  • Enclosing class:
    IntervalSet<T extends java.lang.Comparable<T>>

    public static class IntervalSet.Builder<T extends java.lang.Comparable<T>>
    extends java.lang.Object
    Builder of interval sets, applying the necessary normalization while adding ranges. Data is stored as above, as a sorted map from interval starts to the corresponding end, which satisfies curr().getKey() <= curr().getValue() < next().getKey()
    • Constructor Summary

      Constructors 
      Constructor Description
      Builder()  
      Builder​(T start, T end)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(T start, T end)
      Add an interval to the set and perform normalization.
      void addAll​(IntervalSet<T> otherSet)  
      IntervalSet<T> build()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Builder

        public Builder()
      • Builder

        public Builder​(T start,
                       T end)
    • Method Detail

      • add

        public void add​(T start,
                        T end)
        Add an interval to the set and perform normalization.