Top Description Inners Fields Constructors Methods
org.antlr.v4.runtime

public Class CodePointBuffer

extends Object
Class Inheritance
Imports
java.nio.ByteBuffer, .CharBuffer, .IntBuffer

Wrapper for ByteBuffer / CharBuffer / IntBuffer. Because Java lacks generics on primitive types, these three types do not share an interface, so we have to write one manually.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static enum

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private final CharBuffer
private final IntBuffer
private final CodePointBuffer.Type

Constructor Summary

AccessConstructor and Description
private
CodePointBuffer(CodePointBuffer.Type type, ByteBuffer byteBuffer, CharBuffer charBuffer, IntBuffer intBuffer)

Method Summary

Modifier and TypeMethod and Description
pack-priv int
public static CodePointBuffer.Builder
builder(int initialBufferSize)

pack-priv byte[]
pack-priv char[]
public int
get(int offset)

pack-priv CodePointBuffer.Type
pack-priv int[]
public int
public void
position(int newPosition)

public int
public static CodePointBuffer
withBytes(ByteBuffer byteBuffer)

public static CodePointBuffer
withChars(CharBuffer charBuffer)

public static CodePointBuffer
withInts(IntBuffer intBuffer)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

byteBufferback to summary
private final ByteBuffer byteBuffer
charBufferback to summary
private final CharBuffer charBuffer
intBufferback to summary
private final IntBuffer intBuffer
typeback to summary
private final CodePointBuffer.Type type

Constructor Detail

CodePointBufferback to summary
private CodePointBuffer(CodePointBuffer.Type type, ByteBuffer byteBuffer, CharBuffer charBuffer, IntBuffer intBuffer)

Method Detail

arrayOffsetback to summary
pack-priv int arrayOffset()
builderback to summary
public static CodePointBuffer.Builder builder(int initialBufferSize)
byteArrayback to summary
pack-priv byte[] byteArray()
charArrayback to summary
pack-priv char[] charArray()
getback to summary
public int get(int offset)
getTypeback to summary
pack-priv CodePointBuffer.Type getType()
intArrayback to summary
pack-priv int[] intArray()
positionback to summary
public int position()
positionback to summary
public void position(int newPosition)
remainingback to summary
public int remaining()
withBytesback to summary
public static CodePointBuffer withBytes(ByteBuffer byteBuffer)
withCharsback to summary
public static CodePointBuffer withChars(CharBuffer charBuffer)
withIntsback to summary
public static CodePointBuffer withInts(IntBuffer intBuffer)
org.antlr.v4.runtime back to summary

public Class CodePointBuffer.Builder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private ByteBuffer
private CharBuffer
private IntBuffer
private int
private CodePointBuffer.Type

Constructor Summary

AccessConstructor and Description
private
Builder(int initialBufferSize)

Method Summary

Modifier and TypeMethod and Description
public void
append(CharBuffer utf16In)

private void
private void
private void
private void
public CodePointBuffer
private void
byteToCharBuffer(int toAppend)

private void
byteToIntBuffer(int toAppend)

private void
charToIntBuffer(int toAppend)

public void
ensureRemaining(int remainingNeeded)

pack-priv ByteBuffer
pack-priv CharBuffer
pack-priv IntBuffer
pack-priv CodePointBuffer.Type
private static int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

byteBufferback to summary
private ByteBuffer byteBuffer
charBufferback to summary
private CharBuffer charBuffer
intBufferback to summary
private IntBuffer intBuffer
prevHighSurrogateback to summary
private int prevHighSurrogate
typeback to summary
private CodePointBuffer.Type type

Constructor Detail

Builderback to summary
private Builder(int initialBufferSize)

Method Detail

appendback to summary
public void append(CharBuffer utf16In)
appendArrayback to summary
private void appendArray(CharBuffer utf16In)
appendArrayByteback to summary
private void appendArrayByte(CharBuffer utf16In)
appendArrayCharback to summary
private void appendArrayChar(CharBuffer utf16In)
appendArrayIntback to summary
private void appendArrayInt(CharBuffer utf16In)
buildback to summary
public CodePointBuffer build()
byteToCharBufferback to summary
private void byteToCharBuffer(int toAppend)
byteToIntBufferback to summary
private void byteToIntBuffer(int toAppend)
charToIntBufferback to summary
private void charToIntBuffer(int toAppend)
ensureRemainingback to summary
public void ensureRemaining(int remainingNeeded)
getByteBufferback to summary
pack-priv ByteBuffer getByteBuffer()
getCharBufferback to summary
pack-priv CharBuffer getCharBuffer()
getIntBufferback to summary
pack-priv IntBuffer getIntBuffer()
getTypeback to summary
pack-priv CodePointBuffer.Type getType()
roundUpToNextPowerOfTwoback to summary
private static int roundUpToNextPowerOfTwo(int i)
org.antlr.v4.runtime back to summary

public final Enum CodePointBuffer.Type

extends Enum<CodePointBuffer.Type>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final CodePointBuffer.Type
public static final CodePointBuffer.Type
public static final CodePointBuffer.Type

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static CodePointBuffer.Type
public static CodePointBuffer.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BYTEback to summary
public static final CodePointBuffer.Type BYTE
CHARback to summary
public static final CodePointBuffer.Type CHAR
INTback to summary
public static final CodePointBuffer.Type INT

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static CodePointBuffer.Type valueOf(String name)
valuesback to summary
public static CodePointBuffer.Type[] values()