public abstract class AbstractInterner<T> extends Object
It doesn't guantee it will always return the same object, nor that different threads will return the same object, though the contents should always be the same.
While not technically thread safe, it should still behave correctly.
| Modifier and Type | Field and Description |
|---|---|
protected @NotNull net.openhft.chronicle.bytes.util.AbstractInterner.InternerEntry<T>[] |
entries |
protected int |
mask |
protected int |
shift |
protected boolean |
toggle |
| Constructor and Description |
|---|
AbstractInterner(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
getValue(BytesStore bs,
int length) |
T |
intern(@NotNull Bytes cs) |
T |
intern(@NotNull Bytes cs,
int length) |
T |
intern(@NotNull BytesStore cs) |
T |
intern(@NotNull BytesStore cs,
int length) |
protected boolean |
toggle() |
int |
valueCount() |
@NotNull protected final @NotNull net.openhft.chronicle.bytes.util.AbstractInterner.InternerEntry<T>[] entries
protected final int mask
protected final int shift
protected boolean toggle
public AbstractInterner(int capacity)
throws IllegalArgumentException
IllegalArgumentExceptionpublic T intern(@NotNull @NotNull Bytes cs) throws IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
IllegalArgumentExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionBufferUnderflowExceptionpublic T intern(@NotNull @NotNull BytesStore cs) throws IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
IllegalArgumentExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionBufferUnderflowExceptionpublic T intern(@NotNull @NotNull Bytes cs, int length) throws IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
IllegalArgumentExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionBufferUnderflowExceptionpublic T intern(@NotNull @NotNull BytesStore cs, int length) throws IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
IllegalArgumentExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionBufferUnderflowException@NotNull protected abstract T getValue(BytesStore bs, int length) throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeExceptionprotected boolean toggle()
public int valueCount()
Copyright © 2020. All rights reserved.