Class SpareSpan


  • public class SpareSpan
    extends java.lang.Object
    Author:
    jumperchen
    • Constructor Summary

      Constructors 
      Constructor Description
      SpareSpan()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSpan​(int start, int length)  
      void clear()  
      void deleteSpan​(int start, int length)  
      Span deleteSpanAt​(int sj)  
      void extend​(int index, int size)
      Split the span at index and extends the index with the size.
      void extendAndMerge​(int index, int size)
      Split the span at index and extends the index with the size.
      int getEnd()  
      Span getSpan​(int index)  
      Span getSpanAt​(int sj)  
      int getStart()  
      boolean isEmpty()  
      java.util.List<java.lang.Integer> removeSpans​(int startIdx, int size)  
      void shrink​(int startIdx, int size)
      Shrink spans that is covered from [startIdx] to [startIdx] + [size] - 1
      int size()  
      java.util.stream.Stream<Span> stream()  
      • Methods inherited from class java.lang.Object

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

      • SpareSpan

        public SpareSpan()
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • size

        public int size()
      • stream

        public java.util.stream.Stream<Span> stream()
      • clear

        public void clear()
      • getSpan

        public Span getSpan​(int index)
      • getStart

        public int getStart()
      • getEnd

        public int getEnd()
      • extend

        public void extend​(int index,
                           int size)
        Split the span at index and extends the index with the size.
      • extendAndMerge

        public void extendAndMerge​(int index,
                                   int size)
        Split the span at index and extends the index with the size.
      • shrink

        public void shrink​(int startIdx,
                           int size)
        Shrink spans that is covered from [startIdx] to [startIdx] + [size] - 1
      • removeSpans

        public java.util.List<java.lang.Integer> removeSpans​(int startIdx,
                                                             int size)
      • getSpanAt

        public Span getSpanAt​(int sj)
      • deleteSpanAt

        public Span deleteSpanAt​(int sj)
      • addSpan

        public void addSpan​(int start,
                            int length)
      • deleteSpan

        public void deleteSpan​(int start,
                               int length)