Package org.terrier.structures
Class IndexFactory
- java.lang.Object
-
- org.terrier.structures.IndexFactory
-
public class IndexFactory extends java.lang.Object
This is the main developer API for loading an index. You pass anIndexRef
to the of() static method, and are return the correspondingIndex
, if any can be found. Different indices are supported: anIndexOnDisk
, as well as memory indices. An IndexRef can also target a remote REST server, but no Index can be loaded for such an IndexRef.IndexFactory.IndexLoader
s are used to load indices; They are found using service discovery.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexFactory.DirectIndexLoader
static interface
IndexFactory.IndexLoader
-
Field Summary
Fields Modifier and Type Field Description static java.lang.ClassLoader
cl
-
Constructor Summary
Constructors Constructor Description IndexFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isLoaded(IndexRef ref)
Is this index already loaded?static boolean
isLocal(IndexRef ref)
Is this a local index, or a remote one?static Index
of(java.lang.String indexRefString)
Shortcut method to avoid instantiating an IndexRefstatic Index
of(IndexRef ref)
Load the index for the specified reference.static java.lang.Class<? extends Index>
whoSupports(IndexRef ref)
-
-
-
Method Detail
-
isLoaded
public static boolean isLoaded(IndexRef ref)
Is this index already loaded?
-
isLocal
public static boolean isLocal(IndexRef ref)
Is this a local index, or a remote one?
-
of
public static Index of(java.lang.String indexRefString)
Shortcut method to avoid instantiating an IndexRef
-
-