Save This Page
Home » lucene-3.0.1-src » org.apache » lucene » search » spans » [javadoc | source]
    1   package org.apache.lucene.search.spans;
    2   /**
    3    * Licensed to the Apache Software Foundation (ASF) under one or more
    4    * contributor license agreements.  See the NOTICE file distributed with
    5    * this work for additional information regarding copyright ownership.
    6    * The ASF licenses this file to You under the Apache License, Version 2.0
    7    * (the "License"); you may not use this file except in compliance with
    8    * the License.  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   import java.util.Collection;
   20   import java.io.IOException;
   21   
   22   
   23   /**
   24    *   <font color="#FF0000">
   25      * WARNING: The status of the <b>Payloads</b> feature is experimental.
   26      * The APIs introduced here might change in the future and will not be
   27      * supported anymore in such a case.</font>
   28    *
   29    **/
   30   public interface PayloadSpans extends Spans{
   31      /**
   32      * Returns the payload data for the current span.
   33      * This is invalid until {@link #next()} is called for
   34      * the first time.
   35      * This method must not be called more than once after each call
   36      * of {@link #next()}. However, payloads are loaded lazily,
   37      * so if the payload data for the current position is not needed,
   38      * this method may not be called at all for performance reasons.<br>
   39      * <br>
   40       * Note that the return type is a collection, thus the ordering should not be relied upon.
   41       * <br/>
   42      * <p><font color="#FF0000">
   43      * WARNING: The status of the <b>Payloads</b> feature is experimental.
   44      * The APIs introduced here might change in the future and will not be
   45      * supported anymore in such a case.</font>
   46      *
   47      * @return a List of byte arrays containing the data of this payload, otherwise null if isPayloadAvailable is false
   48      * @throws java.io.IOException
   49       */
   50     // TODO: Remove warning after API has been finalized
   51     Collection/*<byte[]>*/ getPayload() throws IOException;
   52   
   53     /**
   54      * Checks if a payload can be loaded at this position.
   55      * <p/>
   56      * Payloads can only be loaded once per call to
   57      * {@link #next()}.
   58      * <p/>
   59      * <p><font color="#FF0000">
   60      * WARNING: The status of the <b>Payloads</b> feature is experimental.
   61      * The APIs introduced here might change in the future and will not be
   62      * supported anymore in such a case.</font>
   63      *
   64      * @return true if there is a payload available at this position that can be loaded
   65      */
   66     // TODO: Remove warning after API has been finalized
   67     public boolean isPayloadAvailable();
   68   
   69   }

Save This Page
Home » lucene-3.0.1-src » org.apache » lucene » search » spans » [javadoc | source]