Package org.antlr.v4.runtime
Class CodePointBuffer
- java.lang.Object
-
- org.antlr.v4.runtime.CodePointBuffer
-
public class CodePointBuffer extends java.lang.Object
Wrapper forByteBuffer
/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 Class Summary
Nested Classes Modifier and Type Class Description static class
CodePointBuffer.Builder
static class
CodePointBuffer.Type
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer
byteBuffer
private java.nio.CharBuffer
charBuffer
private java.nio.IntBuffer
intBuffer
private CodePointBuffer.Type
type
-
Constructor Summary
Constructors Modifier Constructor Description private
CodePointBuffer(CodePointBuffer.Type type, java.nio.ByteBuffer byteBuffer, java.nio.CharBuffer charBuffer, java.nio.IntBuffer intBuffer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
arrayOffset()
static CodePointBuffer.Builder
builder(int initialBufferSize)
(package private) byte[]
byteArray()
(package private) char[]
charArray()
int
get(int offset)
(package private) CodePointBuffer.Type
getType()
(package private) int[]
intArray()
int
position()
void
position(int newPosition)
int
remaining()
static CodePointBuffer
withBytes(java.nio.ByteBuffer byteBuffer)
static CodePointBuffer
withChars(java.nio.CharBuffer charBuffer)
static CodePointBuffer
withInts(java.nio.IntBuffer intBuffer)
-
-
-
Field Detail
-
type
private final CodePointBuffer.Type type
-
byteBuffer
private final java.nio.ByteBuffer byteBuffer
-
charBuffer
private final java.nio.CharBuffer charBuffer
-
intBuffer
private final java.nio.IntBuffer intBuffer
-
-
Constructor Detail
-
CodePointBuffer
private CodePointBuffer(CodePointBuffer.Type type, java.nio.ByteBuffer byteBuffer, java.nio.CharBuffer charBuffer, java.nio.IntBuffer intBuffer)
-
-
Method Detail
-
withBytes
public static CodePointBuffer withBytes(java.nio.ByteBuffer byteBuffer)
-
withChars
public static CodePointBuffer withChars(java.nio.CharBuffer charBuffer)
-
withInts
public static CodePointBuffer withInts(java.nio.IntBuffer intBuffer)
-
position
public int position()
-
position
public void position(int newPosition)
-
remaining
public int remaining()
-
get
public int get(int offset)
-
getType
CodePointBuffer.Type getType()
-
arrayOffset
int arrayOffset()
-
byteArray
byte[] byteArray()
-
charArray
char[] charArray()
-
intArray
int[] intArray()
-
builder
public static CodePointBuffer.Builder builder(int initialBufferSize)
-
-