public class GenericIndexed<T> extends Object implements Indexed<T>, Closeable
Modifier and Type | Field and Description |
---|---|
static int |
INITIAL_CACHE_CAPACITY |
static ObjectStrategy<String> |
stringStrategy |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static <T> GenericIndexed<T> |
fromArray(T[] objects,
ObjectStrategy<T> strategy) |
static <T> GenericIndexed<T> |
fromIterable(Iterable<T> objectsIterable,
ObjectStrategy<T> strategy) |
T |
get(int index) |
Class<? extends T> |
getClazz() |
long |
getSerializedSize() |
int |
indexOf(T value) |
Iterator<T> |
iterator() |
static <T> GenericIndexed<T> |
read(ByteBuffer buffer,
ObjectStrategy<T> strategy) |
int |
size() |
GenericIndexed<T> |
withCache(int maxBytes)
The returned GenericIndexed must be closed to release the underlying memory
|
void |
writeToChannel(WritableByteChannel channel) |
public static final int INITIAL_CACHE_CAPACITY
public static ObjectStrategy<String> stringStrategy
public static <T> GenericIndexed<T> fromArray(T[] objects, ObjectStrategy<T> strategy)
public static <T> GenericIndexed<T> fromIterable(Iterable<T> objectsIterable, ObjectStrategy<T> strategy)
public long getSerializedSize()
public void writeToChannel(WritableByteChannel channel) throws IOException
IOException
public GenericIndexed<T> withCache(int maxBytes)
maxBytes
- maximum size in bytes of the lookup cachepublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public static <T> GenericIndexed<T> read(ByteBuffer buffer, ObjectStrategy<T> strategy)
Copyright © 2015. All rights reserved.