Class SegmentOpsBase<SEG,​S>

    • Constructor Detail

      • SegmentOpsBase

        public SegmentOpsBase​(SEG emptySeg)
        Creates a SegmentOpsBase that returns emptySeg every time an empty segment should be returned
    • Method Detail

      • charAt

        public final char charAt​(SEG seg,
                                 int index)
        Specified by:
        charAt in interface SegmentOps<SEG,​S>
      • realCharAt

        public abstract char realCharAt​(SEG seg,
                                        int index)
      • getText

        public final java.lang.String getText​(SEG seg)
        Specified by:
        getText in interface SegmentOps<SEG,​S>
      • realGetText

        public abstract java.lang.String realGetText​(SEG seg)
      • realSubSequence

        public abstract SEG realSubSequence​(SEG seg,
                                            int start,
                                            int end)
      • realSubSequence

        public SEG realSubSequence​(SEG seg,
                                   int start)
      • createEmptySeg

        public final SEG createEmptySeg()
        Description copied from interface: SegmentOps
        Creates an empty segment. This method should return the same object for better performance and memory usage.
        Specified by:
        createEmptySeg in interface SegmentOps<SEG,​S>
      • joinStyle

        public java.util.Optional<S> joinStyle​(S currentStyle,
                                               S nextStyle)
        Description copied from interface: SegmentOps
        Joins two consecutive styles together into one or Optional.empty() if they cannot be joined. By default, returns Optional.empty().
        Specified by:
        joinStyle in interface SegmentOps<SEG,​S>