public abstract class Dictionary<T extends Serializable> extends Object
int
keys
to Serializable
objects.Modifier and Type | Method and Description |
---|---|
static <T extends Serializable> |
createHadoopDictionary(Class<T> objectClass,
String fileURL) |
static <T extends Serializable> |
createLocalDictionary(Class<T> objectClass,
File file) |
String |
getDictionaryURL() |
Class<T> |
getObjectClass() |
Integer |
keyFor(T object) |
Integer |
keyFor(T object,
boolean mayGenerate) |
List<Integer> |
keysFor(Iterable<? extends T> objects,
boolean mayGenerate) |
T |
objectFor(int key) |
T |
objectFor(int key,
boolean mustExist) |
List<T> |
objectsFor(Iterable<? extends Integer> keys,
boolean mustExist) |
<L extends List<? super T>> |
toList(L list) |
<M extends Map<? super Integer,? super T>> |
toMap(M map) |
public static <T extends Serializable> Dictionary<T> createLocalDictionary(Class<T> objectClass, File file) throws IOException
IOException
public static <T extends Serializable> Dictionary<T> createHadoopDictionary(Class<T> objectClass, String fileURL) throws IOException
IOException
public String getDictionaryURL()
public T objectFor(int key) throws IOException, NoSuchElementException
IOException
NoSuchElementException
@Nullable public T objectFor(int key, boolean mustExist) throws IOException, NoSuchElementException
IOException
NoSuchElementException
public List<T> objectsFor(Iterable<? extends Integer> keys, boolean mustExist) throws IOException, NoSuchElementException
IOException
NoSuchElementException
public Integer keyFor(T object) throws IOException
IOException
@Nullable public Integer keyFor(T object, boolean mayGenerate) throws IOException
IOException
public List<Integer> keysFor(Iterable<? extends T> objects, boolean mayGenerate) throws IOException
IOException
public <M extends Map<? super Integer,? super T>> M toMap(@Nullable M map) throws IOException
IOException
public <L extends List<? super T>> L toList(@Nullable L list) throws IOException
IOException
Copyright © 2015–2016 FBK-irst. All rights reserved.