public class BufferContent extends SwingContent
buffer
Constructor and Description |
---|
BufferContent() |
BufferContent(int initialSize) |
Modifier and Type | Method and Description |
---|---|
static int |
indexOf(char[] buffer,
int start,
int limit,
char ch) |
static int |
lastIndexOf(char[] buffer,
int start,
int limit,
char ch)
Search for the last occurrence of a character
in buffer[limit..start].
|
long |
scan(char target,
int start,
int end,
int count,
boolean allowQuit)
Search in BUF for COUNT instances of the character TARGET between START and END.
|
createPosition, getChars, getString, insertString, insertString, length, remove
public BufferContent()
public BufferContent(int initialSize)
public static int indexOf(char[] buffer, int start, int limit, char ch)
public static int lastIndexOf(char[] buffer, int start, int limit, char ch)
public final long scan(char target, int start, int end, int count, boolean allowQuit)
END >= START
.
If COUNT is negative, search backwards for the -COUNTth instance;
requires END <= START
.
If COUNT is zero, do anything you please; run rogue, for all I care.
START and END are both 0-origin.
If we find COUNT instances, SHORTAGE is zero, and return the
(0-origin) position after the COUNTth match. Note that for reverse motion
this is not the same as the usual convention for Emacs motion commands.
If we don't find COUNT instances before reaching END, set SHORTAGE
to the number of TARGETs left unfound, and return (shortage<<32|END)
.