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
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 © 2021. All rights reserved.