1 |
7491
|
hahn
|
package edu.ucsb.nceas.metacat.index;
|
2 |
|
|
|
3 |
|
|
import java.util.*;
|
4 |
|
|
|
5 |
|
|
/*
|
6 |
|
|
* Schema for document indexing. The Lucene/SOLR model of a 'document' is a bag of named
|
7 |
|
|
* text objects.
|
8 |
|
|
*/
|
9 |
|
|
public abstract class MCIndexDocDef {
|
10 |
|
|
protected Set<FieldSpec> fields;
|
11 |
|
|
|
12 |
|
|
// do we really want this here? I guess this is the whole question..starting to think not.
|
13 |
|
|
public abstract boolean applies();
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
public MCIndexDocDef(Collection<FieldSpec> fields) {
|
17 |
|
|
this.fields = new HashSet<FieldSpec>(fields);
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
public void add(FieldSpec f) {
|
21 |
|
|
this.fields.add(f);
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
public void add(Collection<FieldSpec> f) {
|
25 |
|
|
this.fields.addAll(f);
|
26 |
|
|
}
|
27 |
|
|
|
28 |
|
|
public void remove(FieldSpec f) {
|
29 |
|
|
this.fields.remove(f);
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
public void remove(Collection<FieldSpec> f) {
|
33 |
|
|
this.fields.removeAll(f);
|
34 |
|
|
}
|
35 |
|
|
}
|