You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by yo...@apache.org on 2009/12/24 16:14:27 UTC
svn commit: r893771 -
/lucene/solr/trunk/src/java/org/apache/solr/schema/PointType.java
Author: yonik
Date: Thu Dec 24 15:14:26 2009
New Revision: 893771
URL: http://svn.apache.org/viewvc?rev=893771&view=rev
Log:
SOLR-1131: formatting - indent inner class
Modified:
lucene/solr/trunk/src/java/org/apache/solr/schema/PointType.java
Modified: lucene/solr/trunk/src/java/org/apache/solr/schema/PointType.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/schema/PointType.java?rev=893771&r1=893770&r2=893771&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/schema/PointType.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/schema/PointType.java Thu Dec 24 15:14:26 2009
@@ -166,110 +166,110 @@
}
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;
- }
+ 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);
+ @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);
+ }
}
- }
- public int dimension() {
- return dimension;
- }
+ public int dimension() {
+ return dimension;
+ }
- @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 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;
-
- PointTypeValueSource that = (PointTypeValueSource) o;
-
- if (dimension != that.dimension) return false;
- if (!field.equals(that.field)) return false;
- if (!subType.equals(that.subType)) return false;
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof PointTypeValueSource)) return false;
+
+ PointTypeValueSource that = (PointTypeValueSource) o;
+
+ 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;
+ }
}
-}
}