Top Description Fields Constructors Methods
jdk.internal.org.jline.reader.impl

public Class BufferImpl

extends Object
implements Buffer
Class Inheritance
All Implemented Interfaces
jdk.internal.org.jline.reader.Buffer
Imports
java.util.Arrays, .Objects, jdk.internal.org.jline.reader.Buffer

A holder for a StringBuilder that also contains the current cursor position.
Authors
Marc Prud'hommeaux, Jason Dillon
Since
2.0

Field Summary

Modifier and TypeField and Description
private int[]
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
public
BufferImpl(int size)

private

Method Summary

Modifier and TypeMethod and Description
private int
adjust(int i)

public int
public int

Returns:

the number of characters backed up
backspace
(final int num)

Implements jdk.internal.org.jline.reader.Buffer.backspace.

Issue num backspaces.

public boolean

Returns:

true if successful
backspace
()

Implements jdk.internal.org.jline.reader.Buffer.backspace.

Issue a backspace.

public boolean
public BufferImpl
public void
public boolean
public int
public int
public boolean
cursor(int position)

Implements jdk.internal.org.jline.reader.Buffer.cursor.

Move the cursor position to the specified absolute index.

public int
public boolean
public boolean
private int
public int
public int

Returns:

The number of spaces we moved
move
(final int
If less than 0, move abs(where) to the left, otherwise move where to the right.
num
)

Implements jdk.internal.org.jline.reader.Buffer.move.

Move the cursor where characters.

private void
public boolean
public int
public int
public String
public String
public String
toString()

Overrides java.lang.Object.toString.

Implements jdk.internal.org.jline.reader.Buffer.toString.

Returns a string representation of the object.

public boolean
public String
public void
write(int
the character to insert
c
)

Implements jdk.internal.org.jline.reader.Buffer.write.

Write the specific character into the buffer, setting the cursor position ahead one.

public void
write(int
the character to insert
c
,
boolean overTyping)

Implements jdk.internal.org.jline.reader.Buffer.write.

Write the specific character into the buffer, setting the cursor position ahead one.

public void
write(CharSequence str)

Implements jdk.internal.org.jline.reader.Buffer.write.

Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.

public void
private void
write(int[] ucps)

public void
zeroOut()

Implements jdk.internal.org.jline.reader.Buffer.zeroOut.

Clear any internal buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bufferback to summary
private int[] buffer
cursorback to summary
private int cursor
cursorColback to summary
private int cursorCol
g0back to summary
private int g0
g1back to summary
private int g1

Constructor Detail

BufferImplback to summary
public BufferImpl()
BufferImplback to summary
public BufferImpl(int size)
BufferImplback to summary
private BufferImpl(BufferImpl buffer)

Method Detail

adjustback to summary
private int adjust(int i)
atCharback to summary
public int atChar(int i)

Implements jdk.internal.org.jline.reader.Buffer.atChar.

backspaceback to summary
public int backspace(final int num)

Implements jdk.internal.org.jline.reader.Buffer.backspace.

Issue num backspaces.

Returns:int

the number of characters backed up

backspaceback to summary
public boolean backspace()

Implements jdk.internal.org.jline.reader.Buffer.backspace.

Issue a backspace.

Returns:boolean

true if successful

clearback to summary
public boolean clear()

Implements jdk.internal.org.jline.reader.Buffer.clear.

copyback to summary
public BufferImpl copy()

Implements jdk.internal.org.jline.reader.Buffer.copy.

copyFromback to summary
public void copyFrom(Buffer buf)

Implements jdk.internal.org.jline.reader.Buffer.copyFrom.

currCharback to summary
public boolean currChar(int ch)

Implements jdk.internal.org.jline.reader.Buffer.currChar.

currCharback to summary
public int currChar()

Implements jdk.internal.org.jline.reader.Buffer.currChar.

cursorback to summary
public int cursor()

Implements jdk.internal.org.jline.reader.Buffer.cursor.

cursorback to summary
public boolean cursor(int position)

Implements jdk.internal.org.jline.reader.Buffer.cursor.

Move the cursor position to the specified absolute index.

deleteback to summary
public int delete(int num)

Implements jdk.internal.org.jline.reader.Buffer.delete.

deleteback to summary
public boolean delete()

Implements jdk.internal.org.jline.reader.Buffer.delete.

downback to summary
public boolean down()

Implements jdk.internal.org.jline.reader.Buffer.down.

getCursorColback to summary
private int getCursorCol()
lengthback to summary
public int length()

Implements jdk.internal.org.jline.reader.Buffer.length.

moveback to summary
public int move(final int num)

Implements jdk.internal.org.jline.reader.Buffer.move.

Move the cursor where characters.

Parameters
num:int

If less than 0, move abs(where) to the left, otherwise move where to the right.

Returns:int

The number of spaces we moved

moveGapToCursorback to summary
private void moveGapToCursor()
moveXYback to summary
public boolean moveXY(int dx, int dy)

Implements jdk.internal.org.jline.reader.Buffer.moveXY.

nextCharback to summary
public int nextChar()

Implements jdk.internal.org.jline.reader.Buffer.nextChar.

prevCharback to summary
public int prevChar()

Implements jdk.internal.org.jline.reader.Buffer.prevChar.

substringback to summary
public String substring(int start)

Implements jdk.internal.org.jline.reader.Buffer.substring.

substringback to summary
public String substring(int start, int end)

Implements jdk.internal.org.jline.reader.Buffer.substring.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements jdk.internal.org.jline.reader.Buffer.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
upback to summary
public boolean up()

Implements jdk.internal.org.jline.reader.Buffer.up.

upToCursorback to summary
public String upToCursor()

Implements jdk.internal.org.jline.reader.Buffer.upToCursor.

writeback to summary
public void write(int c)

Implements jdk.internal.org.jline.reader.Buffer.write.

Write the specific character into the buffer, setting the cursor position ahead one.

Parameters
c:int

the character to insert

writeback to summary
public void write(int c, boolean overTyping)

Implements jdk.internal.org.jline.reader.Buffer.write.

Write the specific character into the buffer, setting the cursor position ahead one. The text may overwrite or insert based on the current setting of overTyping.

Parameters
c:int

the character to insert

writeback to summary
public void write(CharSequence str)

Implements jdk.internal.org.jline.reader.Buffer.write.

Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.

writeback to summary
public void write(CharSequence str, boolean overTyping)

Implements jdk.internal.org.jline.reader.Buffer.write.

writeback to summary
private void write(int[] ucps)
zeroOutback to summary
public void zeroOut()

Implements jdk.internal.org.jline.reader.Buffer.zeroOut.

Doc from jdk.internal.org.jline.reader.Buffer.zeroOut.

Clear any internal buffer.

Annotations
@Override