public class Buffer extends Object
Modifier | Constructor and Description |
---|---|
protected |
Buffer() |
protected |
Buffer(Prompt prompt)
Instantiate a Buffer with given prompt
|
protected |
Buffer(Prompt prompt,
Character mask) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
changeCase()
Switch case if the current character is a letter.
|
protected void |
clear() |
protected boolean |
containRedirection() |
protected void |
delete(int start,
int end) |
protected void |
disablePrompt(boolean disable)
Need to disable prompt in calculations involving search.
|
protected int |
getCursor() |
protected int |
getCursorWithPrompt() |
int |
getDelta() |
String |
getLine() |
protected char[] |
getLineFrom(int position)
Get line from given param
|
String |
getLineNoMask() |
String |
getLineWithPrompt()
Get the complete line (including prompt)
|
protected Prompt |
getPrompt() |
protected int |
getRedirectionPosition() |
protected void |
insert(int start,
String in) |
boolean |
isMasking() |
protected int |
length() |
protected char[] |
move(int move,
int termWidth)
Move the cursor left if the param is negative,
and right if its positive.
|
protected char[] |
move(int move,
int termWidth,
boolean viMode) |
static char[] |
printAnsi(char[] out)
Return a ansified string based on param
|
static char[] |
printAnsi(String out)
Return a ansified string based on param
|
protected void |
replaceChar(char rChar) |
protected void |
reset(Prompt prompt)
Reset the buffer
|
protected void |
reset(Prompt prompt,
Character mask) |
protected void |
setCursor(int cursor) |
protected void |
setLine(String line) |
protected int |
totalLength() |
void |
write(char c)
Write a char to the line and update cursor accordingly
|
void |
write(String str)
Write a string to the line and update cursor accordingly
|
protected Buffer()
protected Buffer(Prompt prompt)
prompt
- set promptprotected void reset(Prompt prompt)
prompt
- set promptprotected int length()
protected int totalLength()
protected int getCursor()
protected int getCursorWithPrompt()
protected Prompt getPrompt()
protected void setCursor(int cursor)
public boolean isMasking()
protected void disablePrompt(boolean disable)
disable
- prompt or notprotected char[] move(int move, int termWidth)
move
- where to movetermWidth
- terminal widthprotected char[] move(int move, int termWidth, boolean viMode)
public static char[] printAnsi(String out)
out
- stringpublic static char[] printAnsi(char[] out)
out
- what will be ansifiedprotected char[] getLineFrom(int position)
position
- in linepublic String getLine()
public String getLineNoMask()
protected void setLine(String line)
protected void delete(int start, int end)
protected void insert(int start, String in)
public String getLineWithPrompt()
public void write(char c)
c
- charpublic void write(String str)
str
- stringprotected void clear()
public int getDelta()
protected boolean changeCase()
protected void replaceChar(char rChar)
protected boolean containRedirection()
protected int getRedirectionPosition()
Copyright © 2018 JBoss by Red Hat. All rights reserved.