Class SimpleBoundaryScanner

  • All Implemented Interfaces:
    BoundaryScanner

    public class SimpleBoundaryScanner
    extends java.lang.Object
    implements BoundaryScanner
    Simple boundary scanner implementation that divides fragments based on a set of separator characters.
    • Field Detail

      • DEFAULT_BOUNDARY_CHARS

        public static final java.lang.Character[] DEFAULT_BOUNDARY_CHARS
    • Constructor Detail

      • SimpleBoundaryScanner

        public SimpleBoundaryScanner()
      • SimpleBoundaryScanner

        public SimpleBoundaryScanner​(int maxScan)
      • SimpleBoundaryScanner

        public SimpleBoundaryScanner​(java.lang.Character[] boundaryChars)
      • SimpleBoundaryScanner

        public SimpleBoundaryScanner​(int maxScan,
                                     java.lang.Character[] boundaryChars)
      • SimpleBoundaryScanner

        public SimpleBoundaryScanner​(int maxScan,
                                     java.util.Set<java.lang.Character> boundaryChars)
    • Method Detail

      • findStartOffset

        public int findStartOffset​(java.lang.StringBuilder buffer,
                                   int start)
        Description copied from interface: BoundaryScanner
        Scan backward to find end offset.
        Specified by:
        findStartOffset in interface BoundaryScanner
        Parameters:
        buffer - scanned object
        start - start offset to begin
        Returns:
        the found start offset
      • findEndOffset

        public int findEndOffset​(java.lang.StringBuilder buffer,
                                 int start)
        Description copied from interface: BoundaryScanner
        Scan forward to find start offset.
        Specified by:
        findEndOffset in interface BoundaryScanner
        Parameters:
        buffer - scanned object
        start - start offset to begin
        Returns:
        the found end offset