public override int GetOrd(int docID) { if (docID < 0 || docID >= outerInstance.MAX_DOC) { throw new IndexOutOfRangeException("docID must be 0 .. " + (outerInstance.MAX_DOC - 1) + "; got " + docID); } @in.Seek(field.DataStartFilePointer + field.NumValues * (9 + field.Pattern.Length + field.MaxLength) + docID * (1 + field.OrdPattern.Length)); SimpleTextUtil.ReadLine(@in, scratch); try { return((long)(int)ordDecoder.Parse(scratch.Utf8ToString()) - 1); } catch (ParseException pe) { CorruptIndexException e = new CorruptIndexException("failed to parse ord (resource=" + @in + ")"); e.initCause(pe); throw e; } }
public override Number Parse(string @string) { return(_format.Parse(@string)); }