public class FRBRData
extends Object
Modifier and Type | Field and Description |
---|---|
private static WeakHashMap |
cache
Cached data.
|
IntMultiMap |
docTags |
static int |
FIRST_TYPE |
static int |
LAST_TYPE |
IntMultiMap |
tagDocs |
TagArray |
tags |
static int |
TYPE_AUTHOR |
static int |
TYPE_DATE |
static int |
TYPE_ID |
static int |
TYPE_TITLE |
Modifier | Constructor and Description |
---|---|
private |
FRBRData(IndexReader reader,
String[] fields)
Read tags for a given set of fields from the given reader.
|
Modifier and Type | Method and Description |
---|---|
private int |
addTag(String term,
int type)
Add a tag for the given term and type.
|
private int |
calcType(String field)
Calculate the type of a given field, based on the field name.
|
static FRBRData |
getCachedTags(IndexReader reader,
String[] fields)
Retrieves tags for a given set of fields from a given reader.
|
private int |
readField(IndexReader reader,
String field,
int type)
Read all the term->document mappings from a given field, and add them to
the tag array, and docTags mapping.
|
private static WeakHashMap cache
public static final int FIRST_TYPE
public static final int TYPE_TITLE
public static final int TYPE_AUTHOR
public static final int TYPE_DATE
public static final int TYPE_ID
public static final int LAST_TYPE
public final TagArray tags
public final IntMultiMap docTags
public final IntMultiMap tagDocs
private FRBRData(IndexReader reader, String[] fields) throws IOException
getCachedTags(IndexReader, String[])
.IOException
public static FRBRData getCachedTags(IndexReader reader, String[] fields) throws IOException
reader
- Where to read the tags fromfields
- Which fields to readIOException
private int readField(IndexReader reader, String field, int type) throws IOException
IOException
private int addTag(String term, int type)
term
- Term to parse and addtype
- Type to add the tag underprivate int calcType(String field) throws IOException
IOException