~ubuntu-branches/ubuntu/trusty/pylucene/trusty

« back to all changes in this revision

Viewing changes to java/org/apache/pylucene/search/PythonFieldComparatorSource.java

  • Committer: Package Import Robot
  • Author(s): Dmitry Nezhevenko
  • Date: 2012-04-23 16:43:55 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120423164355-grqtepnwtecdjfk2
Tags: 3.5.0-1
* New maintainer (closes: 670179)
* New upstream release
* Switch to dpkg-source 3.0 (quilt) format
* Switch to machine-readable debian/copyright
* Bump debian/compat to 8, drop debian/pycompat
* Switch from cdbs to dh
* Add watch file
* Build for all supported versions of python2 (closes: 581198, 632240)
* Rename binary package to python-lucene (closes: 581197)
* Add -dbg package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ====================================================================
 
2
 *   Licensed under the Apache License, Version 2.0 (the "License");
 
3
 *   you may not use this file except in compliance with the License.
 
4
 *   You may obtain a copy of the License at
 
5
 *
 
6
 *       http://www.apache.org/licenses/LICENSE-2.0
 
7
 *
 
8
 *   Unless required by applicable law or agreed to in writing, software
 
9
 *   distributed under the License is distributed on an "AS IS" BASIS,
 
10
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
11
 *   See the License for the specific language governing permissions and
 
12
 *   limitations under the License.
 
13
 * ====================================================================
 
14
 */
 
15
 
 
16
package org.apache.pylucene.search;
 
17
 
 
18
import java.io.IOException;
 
19
import org.apache.lucene.search.FieldComparatorSource;
 
20
import org.apache.lucene.search.FieldComparator;
 
21
import org.apache.lucene.index.IndexReader;
 
22
 
 
23
/**
 
24
 * @author Andi Vajda
 
25
 */
 
26
 
 
27
public class PythonFieldComparatorSource extends FieldComparatorSource {
 
28
 
 
29
    private long pythonObject;
 
30
 
 
31
    public PythonFieldComparatorSource()
 
32
    {
 
33
    }
 
34
 
 
35
    public void pythonExtension(long pythonObject)
 
36
    {
 
37
        this.pythonObject = pythonObject;
 
38
    }
 
39
    public long pythonExtension()
 
40
    {
 
41
        return this.pythonObject;
 
42
    }
 
43
 
 
44
    public void finalize()
 
45
        throws Throwable
 
46
    {
 
47
        pythonDecRef();
 
48
    }
 
49
 
 
50
    public native void pythonDecRef();
 
51
 
 
52
    public native FieldComparator newComparator(String fieldname, int numHits,
 
53
                                                int sortPos, boolean reversed)
 
54
        throws IOException;
 
55
}