public abstract class AbstractInterner<T> extends Object
It doesn't guarantee 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 net.openhft.chronicle.bytes.util.AbstractInterner.InternerEntry<T>[] |
entries |
protected int |
mask |
protected int |
shift |
protected boolean |
toggle |
Modifier | Constructor and Description |
---|---|
protected |
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() |
protected final net.openhft.chronicle.bytes.util.AbstractInterner.InternerEntry<T>[] entries
protected final int mask
protected final int shift
protected boolean toggle
protected AbstractInterner(int capacity) throws IllegalArgumentException
IllegalArgumentException
public T intern(@NotNull @NotNull Bytes cs) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalStateException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalStateException
public T intern(@NotNull @NotNull BytesStore cs) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalStateException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalStateException
public T intern(@NotNull @NotNull Bytes cs, int length) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalStateException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalStateException
public T intern(@NotNull @NotNull BytesStore cs, int length) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalStateException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalStateException
@NotNull protected abstract T getValue(BytesStore bs, int length) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException, BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
BufferUnderflowException
protected boolean toggle()
public int valueCount()
Copyright © 2022. All rights reserved.