add --shared
[pylucene.git] / lucene-java-3.4.0 / lucene / src / java / org / apache / lucene / document / FieldSelectorResult.java
1 package org.apache.lucene.document;
2
3 /**
4  * Copyright 2004 The Apache Software Foundation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 /**
20  *  Provides information about what should be done with this Field 
21  *
22  **/
23 public enum FieldSelectorResult {
24
25     /**
26      * Load this {@link Field} every time the {@link Document} is loaded, reading in the data as it is encountered.
27      *  {@link Document#getField(String)} and {@link Document#getFieldable(String)} should not return null.
28      *<p/>
29      * {@link Document#add(Fieldable)} should be called by the Reader.
30      */
31   LOAD,
32
33     /**
34      * Lazily load this {@link Field}.  This means the {@link Field} is valid, but it may not actually contain its data until
35      * invoked.  {@link Document#getField(String)} SHOULD NOT BE USED.  {@link Document#getFieldable(String)} is safe to use and should
36      * return a valid instance of a {@link Fieldable}.
37      *<p/>
38      * {@link Document#add(Fieldable)} should be called by the Reader.
39      */
40   LAZY_LOAD,
41
42     /**
43      * Do not load the {@link Field}.  {@link Document#getField(String)} and {@link Document#getFieldable(String)} should return null.
44      * {@link Document#add(Fieldable)} is not called.
45      * <p/>
46      * {@link Document#add(Fieldable)} should not be called by the Reader.
47      */
48   NO_LOAD,
49
50     /**
51      * Load this field as in the {@link #LOAD} case, but immediately return from {@link Field} loading for the {@link Document}.  Thus, the
52      * Document may not have its complete set of Fields.  {@link Document#getField(String)} and {@link Document#getFieldable(String)} should
53      * both be valid for this {@link Field}
54      * <p/>
55      * {@link Document#add(Fieldable)} should be called by the Reader.
56      */
57   LOAD_AND_BREAK,
58
59     /** Expert:  Load the size of this {@link Field} rather than its value.
60      * Size is measured as number of bytes required to store the field == bytes for a binary or any compressed value, and 2*chars for a String value.
61      * The size is stored as a binary value, represented as an int in a byte[], with the higher order byte first in [0]
62      */
63   SIZE,
64
65     /** Expert: Like {@link #SIZE} but immediately break from the field loading loop, i.e., stop loading further fields, after the size is loaded */         
66   SIZE_AND_BREAK,
67
68   /**
69      * Lazily load this {@link Field}, but do not cache the result.  This means the {@link Field} is valid, but it may not actually contain its data until
70      * invoked.  {@link Document#getField(String)} SHOULD NOT BE USED.  {@link Document#getFieldable(String)} is safe to use and should
71      * return a valid instance of a {@link Fieldable}.
72      *<p/>
73      * {@link Document#add(Fieldable)} should be called by the Reader.
74      */
75   LATENT
76 }