PageRenderTime 32ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/3.1.0/src/org/getopt/luke/decoders/NumFloatDecoder.java

http://luke.googlecode.com/
Java | 21 lines | 15 code | 6 blank | 0 comment | 0 complexity | e5ca242759114dbd22b647e9aa0b5079 MD5 | raw file
 1package org.getopt.luke.decoders;
 2
 3import org.apache.lucene.util.NumericUtils;
 4
 5public class NumFloatDecoder implements Decoder {
 6
 7  @Override
 8  public String decodeTerm(String fieldName, Object value) {
 9    return Float.toString(NumericUtils.prefixCodedToFloat(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-float";
19  }
20
21}