Buffer
public class BufferImpl extends Object implements Buffer
StringBuilder
that also contains the current cursor position.Constructor | Description |
---|---|
BufferImpl() |
|
BufferImpl(int size) |
Modifier and Type | Method | Description |
---|---|---|
int |
atChar(int i) |
|
boolean |
backspace() |
Issue a backspace.
|
int |
backspace(int num) |
Issue num backspaces.
|
boolean |
clear() |
|
BufferImpl |
copy() |
|
void |
copyFrom(Buffer buf) |
|
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() |
|
String |
substring(int start) |
|
String |
substring(int start,
int end) |
|
String |
toString() |
|
boolean |
up() |
|
String |
upToCursor() |
|
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.
|
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) |
public BufferImpl copy()
public void write(int c)
public void write(int c, boolean overTyping)
overTyping
.public void write(CharSequence str)
public void write(CharSequence str, boolean overTyping)
public String upToCursor()
upToCursor
in interface Buffer
public boolean cursor(int position)
public int move(int num)
public int backspace(int num)
public boolean backspace()
public String toString()
Copyright © 2020. All rights reserved.