`
deepfuture
  • 浏览: 4426549 次
  • 性别: Icon_minigender_1
  • 来自: 湛江
博客专栏
073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64
SQLite源码剖析
浏览量:80286
1591c4b8-62f1-3d3e-9551-25c77465da96
WIN32汇编语言学习应用...
浏览量:70723
F5390db6-59dd-338f-ba18-4e93943ff06a
神奇的perl
浏览量:103916
Dac44363-8a80-3836-99aa-f7b7780fa6e2
lucene等搜索引擎解析...
浏览量:287235
Ec49a563-4109-3c69-9c83-8f6d068ba113
深入lucene3.5源码...
浏览量:15112
9b99bfc2-19c2-3346-9100-7f8879c731ce
VB.NET并行与分布式编...
浏览量:68221
B1db2af3-06b3-35bb-ac08-59ff2d1324b4
silverlight 5...
浏览量:32477
4a56b548-ab3d-35af-a984-e0781d142c23
算法下午茶系列
浏览量:46227
社区版块
存档分类
最新评论

lucene3.5之Bits

 
阅读更多
package org.apache.lucene.util;

/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @lucene.experimental
 */

public interface Bits {
  public boolean get(int index);
  public int length();

  public static final Bits[] EMPTY_ARRAY = new Bits[0];
  
  public static class MatchAllBits implements Bits {
    final int len;
    
    public MatchAllBits( int len ) {
      this.len = len;
    }

    public boolean get(int index) {
      return true;
    }

    public int length() {
      return len;
    }
  }

  public static class MatchNoBits implements Bits {
    final int len;
    
    public MatchNoBits( int len ) {
      this.len = len;
    }

    public boolean get(int index) {
      return false;
    }

    public int length() {
      return len;
    }
  }
}

 

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics