PageRenderTime 19ms CodeModel.GetById 17ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/1.0.1/src/org/getopt/luke/decoders/NumIntDecoder.java

http://luke.googlecode.com/
Java | 21 lines | 15 code | 6 blank | 0 comment | 0 complexity | 618c7bce6215fbe30c3b16f3ca207b84 MD5 | raw file
 1package org.getopt.luke.decoders;
 2
 3import org.apache.lucene.util.NumericUtils;
 4
 5public class NumIntDecoder implements Decoder {
 6
 7  @Override
 8  public String decodeTerm(String fieldName, Object value) {
 9    return Integer.toString(NumericUtils.prefixCodedToInt(value.toString()));
10  }
11  
12  @Override
13  public String decodeStored(String fieldName, Object value) {
14    return value.toString();
15  }
16  
17  public String toString() {
18    return "numeric-int";
19  }
20
21}