public class BufferImpl extends Object implements Buffer
StringBuilder
that also contains the current cursor position.Constructor and Description |
---|
BufferImpl() |
BufferImpl(int size) |
Modifier and Type | Method and Description |
---|---|
int |
atChar(int i) |
boolean |
backspace()
Issue a backspace.
|
int |
backspace(int num)
Issue num backspaces.
|
boolean |
clear() |
BufferImpl |
copy() |
int |
currChar() |
boolean |
currChar(int ch) |
int |
cursor() |
boolean |
cursor(int position)
Move the cursor position to the specified absolute index.
|
boolean |
delete() |
int |
delete(int num) |
boolean |
down() |
int |
length() |
int |
move(int num)
Move the cursor where characters.
|
boolean |
moveXY(int dx,
int dy) |
int |
nextChar() |
int |
prevChar() |
void |
setBuffer(BufferImpl that) |
String |
substring(int start) |
String |
substring(int start,
int end) |
String |
toString() |
boolean |
up() |
String |
upToCursor() |
void |
write(CharSequence str)
Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.
|
void |
write(CharSequence str,
boolean overTyping) |
void |
write(int c)
Write the specific character into the buffer, setting the cursor position
ahead one.
|
void |
write(int c,
boolean overTyping)
Write the specific character into the buffer, setting the cursor position
ahead one.
|
public BufferImpl copy()
public int cursor()
public int length()
public boolean currChar(int ch)
public int currChar()
public int prevChar()
public int nextChar()
public int atChar(int i)
public void write(int c)
c
- the character to insertpublic void write(int c, boolean overTyping)
overTyping
.c
- the character to insertpublic void write(CharSequence str)
public void write(CharSequence str, boolean overTyping)
public boolean clear()
public String substring(int start)
public String substring(int start, int end)
public String upToCursor()
public boolean cursor(int position)
public int move(int num)
num
- If less than 0, move abs(where) to the left, otherwise move where to the right.public boolean up()
public boolean down()
public boolean moveXY(int dx, int dy)
public int backspace(int num)
public boolean backspace()
public int delete(int num)
public boolean delete()
public void setBuffer(BufferImpl that)
Copyright © 2019. All rights reserved.