@Override public ValueSource getValueSource(String name) { Object o = map.get(name); if (o == null) { throw new IllegalArgumentException("Invalid reference '" + name + "'"); } else if (o instanceof Expression) { return ((Expression)o).getValueSource(this); } else if (o instanceof ValueSource) { return ((ValueSource)o); } SortField field = (SortField) o; switch(field.getType()) { case INT: return new IntFieldSource(field.getField(), (IntParser) field.getParser()); case LONG: return new LongFieldSource(field.getField(), (LongParser) field.getParser()); case FLOAT: return new FloatFieldSource(field.getField(), (FloatParser) field.getParser()); case DOUBLE: return new DoubleFieldSource(field.getField(), (DoubleParser) field.getParser()); case SCORE: return getScoreValueSource(); default: throw new UnsupportedOperationException(); } }
@Override public ValueSource getValueSource(String name) { Object o = map.get(name); if (o == null) { throw new IllegalArgumentException("Invalid reference '" + name + "'"); } else if (o instanceof Expression) { return ((Expression)o).getValueSource(this); } SortField field = (SortField) o; switch(field.getType()) { case INT: return new IntFieldSource(field.getField(), (IntParser) field.getParser()); case LONG: return new LongFieldSource(field.getField(), (LongParser) field.getParser()); case FLOAT: return new FloatFieldSource(field.getField(), (FloatParser) field.getParser()); case DOUBLE: return new DoubleFieldSource(field.getField(), (DoubleParser) field.getParser()); case SCORE: return getScoreValueSource(); default: throw new UnsupportedOperationException(); } }
public IntComparator(int numHits, String field, FieldCache.Parser parser, Integer missingValue) { super(field, missingValue); values = new int[numHits]; this.parser = (IntParser) parser; }
IntComparator(int numHits, String field, FieldCache.Parser parser, Integer missingValue) { super(field, missingValue); values = new int[numHits]; this.parser = (IntParser) parser; }