Apache Lucene open-source search software
SOLR-1131: formatting - indent inner class
Yonik Seeley78c7dc3dbe1a
diff --git a/src/java/org/apache/solr/schema/PointType.java b/src/java/org/apache/solr/schema/PointType.javaindex 79cec4e0e6e..d41f1d73f0d 100644--- a/src/java/org/apache/solr/schema/PointType.java+++ b/src/java/org/apache/solr/schema/PointType.java@@ -166,110 +166,110 @@ public class PointType extends CoordinateFieldType {}class PointTypeValueSource extends MultiValueSource {- protected SchemaField field;- protected FieldType subType;- protected int dimension;- private QParser parser;-- public PointTypeValueSource(SchemaField field, int dimension, FieldType subType, QParser parser) {- this.field = field;- this.dimension = dimension;- this.subType = subType;- this.parser = parser;- }-- @Override- public void createWeight(Map context, Searcher searcher) throws IOException {- String name = field.getName();- String suffix = FieldType.POLY_FIELD_SEPARATOR + subType.typeName;- int len = name.length();- StringBuilder bldr = new StringBuilder(len + 3 + suffix.length());//should be enough buffer to handle most values of j.- bldr.append(name);- for (int i = 0; i < dimension; i++) {- bldr.append(i).append(suffix);- SchemaField sf = schema.getField(bldr.toString());- subType.getValueSource(sf, parser).createWeight(context, searcher);- bldr.setLength(len);+ protected SchemaField field;+ protected FieldType subType;+ protected int dimension;+ private QParser parser;++ public PointTypeValueSource(SchemaField field, int dimension, FieldType subType, QParser parser) {+ this.field = field;+ this.dimension = dimension;+ this.subType = subType;+ this.parser = parser;}- }- public int dimension() {- return dimension;- }+ @Override+ public void createWeight(Map context, Searcher searcher) throws IOException {+ String name = field.getName();+ String suffix = FieldType.POLY_FIELD_SEPARATOR + subType.typeName;+ int len = name.length();+ StringBuilder bldr = new StringBuilder(len + 3 + suffix.length());//should be enough buffer to handle most values of j.+ bldr.append(name);+ for (int i = 0; i < dimension; i++) {+ bldr.append(i).append(suffix);+ SchemaField sf = schema.getField(bldr.toString());+ subType.getValueSource(sf, parser).createWeight(context, searcher);+ bldr.setLength(len);+ }+ }- @Override- public DocValues getValues(Map context, IndexReader reader) throws IOException {- final DocValues[] valsArr1 = new DocValues[dimension];- String name = field.getName();- String suffix = FieldType.POLY_FIELD_SEPARATOR + subType.typeName;- int len = name.length();- StringBuilder bldr = new StringBuilder(len + 3 + suffix.length());//should be enough buffer to handle most values of j.- bldr.append(name);- for (int i = 0; i < dimension; i++) {- bldr.append(i).append(suffix);- SchemaField sf = schema.getField(bldr.toString());- valsArr1[i] = subType.getValueSource(sf, parser).getValues(context, reader);- bldr.setLength(len);+ public int dimension() {+ return dimension;}- return new DocValues() {- //TODO: not sure how to handle the other types at this moment- @Override- public void doubleVal(int doc, double[] vals) {- //TODO: check whether vals.length == dimension or assume its handled elsewhere?- for (int i = 0; i < dimension; i++) {- vals[i] = valsArr1[i].doubleVal(doc);- }++ @Override+ public DocValues getValues(Map context, IndexReader reader) throws IOException {+ final DocValues[] valsArr1 = new DocValues[dimension];+ String name = field.getName();+ String suffix = FieldType.POLY_FIELD_SEPARATOR + subType.typeName;+ int len = name.length();+ StringBuilder bldr = new StringBuilder(len + 3 + suffix.length());//should be enough buffer to handle most values of j.+ bldr.append(name);+ for (int i = 0; i < dimension; i++) {+ bldr.append(i).append(suffix);+ SchemaField sf = schema.getField(bldr.toString());+ valsArr1[i] = subType.getValueSource(sf, parser).getValues(context, reader);+ bldr.setLength(len);}+ return new DocValues() {+ //TODO: not sure how to handle the other types at this moment+ @Override+ public void doubleVal(int doc, double[] vals) {+ //TODO: check whether vals.length == dimension or assume its handled elsewhere?+ for (int i = 0; i < dimension; i++) {+ vals[i] = valsArr1[i].doubleVal(doc);+ }+ }- @Override- public String toString(int doc) {- StringBuilder sb = new StringBuilder("point(");- boolean firstTime = true;- for (DocValues docValues : valsArr1) {- if (firstTime == false) {- sb.append(",");- } else {- firstTime = true;+ @Override+ public String toString(int doc) {+ StringBuilder sb = new StringBuilder("point(");+ boolean firstTime = true;+ for (DocValues docValues : valsArr1) {+ if (firstTime == false) {+ sb.append(",");+ } else {+ firstTime = true;+ }+ sb.append(docValues.toString(doc));}- sb.append(docValues.toString(doc));+ sb.append(")");+ return sb.toString();}- sb.append(")");- return sb.toString();- }- };- }+ };+ }- public String description() {- StringBuilder sb = new StringBuilder();- sb.append("point(");- sb.append("fld=").append(field.name).append(", subType=").append(subType.typeName)- .append(", dimension=").append(dimension).append(')');- return sb.toString();- }+ public String description() {+ StringBuilder sb = new StringBuilder();+ sb.append("point(");+ sb.append("fld=").append(field.name).append(", subType=").append(subType.typeName)+ .append(", dimension=").append(dimension).append(')');+ return sb.toString();+ }- @Override- public boolean equals(Object o) {- if (this == o) return true;- if (!(o instanceof PointTypeValueSource)) return false;+ @Override+ public boolean equals(Object o) {+ if (this == o) return true;+ if (!(o instanceof PointTypeValueSource)) return false;- PointTypeValueSource that = (PointTypeValueSource) o;+ PointTypeValueSource that = (PointTypeValueSource) o;- if (dimension != that.dimension) return false;- if (!field.equals(that.field)) return false;- if (!subType.equals(that.subType)) return false;+ if (dimension != that.dimension) return false;+ if (!field.equals(that.field)) return false;+ if (!subType.equals(that.subType)) return false;- return true;- }+ return true;+ }- @Override- public int hashCode() {- int result = field.hashCode();- result = 31 * result + subType.hashCode();- result = 31 * result + dimension;- return result;+ @Override+ public int hashCode() {+ int result = field.hashCode();+ result = 31 * result + subType.hashCode();+ result = 31 * result + dimension;+ return result;+ }}-}}