Add missing @Override annotations (issue 316, 317, 319, 320 among others)
git-svn-id: http://google-refine.googlecode.com/svn/trunk@2089 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
73acd497e9
commit
eebc225abc
@ -54,6 +54,7 @@ public class NominalFacetChoice implements Jsonizable {
|
||||
this.decoratedValue = decoratedValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
writer.object();
|
||||
|
@ -110,6 +110,7 @@ public class RangeFacet implements Facet {
|
||||
protected static final String TO = "to";
|
||||
protected static final String FROM = "from";
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
@ -157,6 +158,7 @@ public class RangeFacet implements Facet {
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeFromJSON(Project project, JSONObject o) throws Exception {
|
||||
_name = o.getString("name");
|
||||
_expression = o.getString("expression");
|
||||
@ -195,11 +197,13 @@ public class RangeFacet implements Facet {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RowFilter getRowFilter(Project project) {
|
||||
if (_eval != null && _errorMessage == null && _selected) {
|
||||
return new ExpressionNumberComparisonRowFilter(
|
||||
getRowEvaluable(project), _selectNumeric, _selectNonNumeric, _selectBlank, _selectError) {
|
||||
|
||||
@Override
|
||||
protected boolean checkValue(double d) {
|
||||
return d >= _from && d < _to;
|
||||
};
|
||||
@ -215,6 +219,7 @@ public class RangeFacet implements Facet {
|
||||
return rowFilter == null ? null : new AnyRowRecordFilter(rowFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeChoices(Project project, FilteredRows filteredRows) {
|
||||
if (_eval != null && _errorMessage == null) {
|
||||
RowEvaluable rowEvaluable = getRowEvaluable(project);
|
||||
@ -237,6 +242,7 @@ public class RangeFacet implements Facet {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeChoices(Project project, FilteredRecords filteredRecords) {
|
||||
if (_eval != null && _errorMessage == null) {
|
||||
RowEvaluable rowEvaluable = getRowEvaluable(project);
|
||||
|
@ -163,6 +163,7 @@ public class ScatterplotFacet implements Facet {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options) throws JSONException {
|
||||
|
||||
writer.object();
|
||||
@ -204,6 +205,7 @@ public class ScatterplotFacet implements Facet {
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeFromJSON(Project project, JSONObject o) throws Exception {
|
||||
name = o.getString(NAME);
|
||||
l = size = (o.has(SIZE)) ? o.getInt(SIZE) : 100;
|
||||
@ -285,6 +287,7 @@ public class ScatterplotFacet implements Facet {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public RowFilter getRowFilter(Project project) {
|
||||
if (selected &&
|
||||
eval_x != null && errorMessage_x == null &&
|
||||
@ -298,6 +301,7 @@ public class ScatterplotFacet implements Facet {
|
||||
double from_y_pixels = from_y * l;
|
||||
double to_y_pixels = to_y * l;
|
||||
|
||||
@Override
|
||||
protected boolean checkValues(double x, double y) {
|
||||
Point2D.Double p = new Point2D.Double(x,y);
|
||||
p = translateCoordinates(p, min_x, max_x, min_y, max_y, dim_x, dim_y, l, t);
|
||||
@ -315,6 +319,7 @@ public class ScatterplotFacet implements Facet {
|
||||
return rowFilter == null ? null : new AnyRowRecordFilter(rowFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeChoices(Project project, FilteredRows filteredRows) {
|
||||
if (eval_x != null && eval_y != null && errorMessage_x == null && errorMessage_y == null) {
|
||||
Column column_x = project.columnModel.getColumnByCellIndex(columnIndex_x);
|
||||
@ -345,6 +350,7 @@ public class ScatterplotFacet implements Facet {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeChoices(Project project, FilteredRecords filteredRecords) {
|
||||
if (eval_x != null && eval_y != null && errorMessage_x == null && errorMessage_y == null) {
|
||||
Column column_x = project.columnModel.getColumnByCellIndex(columnIndex_x);
|
||||
|
@ -124,12 +124,14 @@ public class TextSearchFacet implements Facet {
|
||||
|
||||
if ("regex".equals(_mode)) {
|
||||
return new ExpressionStringComparisonRowFilter(eval, _columnName, _cellIndex) {
|
||||
@Override
|
||||
protected boolean checkValue(String s) {
|
||||
return _pattern.matcher(s).find();
|
||||
};
|
||||
};
|
||||
} else {
|
||||
return new ExpressionStringComparisonRowFilter(eval, _columnName, _cellIndex) {
|
||||
@Override
|
||||
protected boolean checkValue(String s) {
|
||||
return (_caseSensitive ? s : s.toLowerCase()).contains(_query);
|
||||
};
|
||||
|
@ -65,6 +65,7 @@ public class TimeRangeFacet extends RangeFacet {
|
||||
protected int _timeCount;
|
||||
protected int _nonTimeCount;
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options) throws JSONException {
|
||||
|
||||
writer.object();
|
||||
@ -109,6 +110,7 @@ public class TimeRangeFacet extends RangeFacet {
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeFromJSON(Project project, JSONObject o) throws Exception {
|
||||
_name = o.getString("name");
|
||||
_expression = o.getString("expression");
|
||||
@ -147,11 +149,13 @@ public class TimeRangeFacet extends RangeFacet {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RowFilter getRowFilter(Project project) {
|
||||
if (_eval != null && _errorMessage == null && _selected) {
|
||||
return new ExpressionTimeComparisonRowFilter(
|
||||
getRowEvaluable(project), _selectTime, _selectNonTime, _selectBlank, _selectError) {
|
||||
|
||||
@Override
|
||||
protected boolean checkValue(long t) {
|
||||
return t >= _from && t < _to;
|
||||
};
|
||||
@ -161,6 +165,7 @@ public class TimeRangeFacet extends RangeFacet {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeChoices(Project project, FilteredRows filteredRows) {
|
||||
if (_eval != null && _errorMessage == null) {
|
||||
RowEvaluable rowEvaluable = getRowEvaluable(project);
|
||||
@ -182,6 +187,7 @@ public class TimeRangeFacet extends RangeFacet {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeChoices(Project project, FilteredRecords filteredRecords) {
|
||||
if (_eval != null && _errorMessage == null) {
|
||||
RowEvaluable rowEvaluable = getRowEvaluable(project);
|
||||
|
@ -72,6 +72,7 @@ abstract public class DualExpressionsNumberComparisonRowFilter implements RowFil
|
||||
_y_cellIndex = y_cellIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterRow(Project project, int rowIndex, Row row) {
|
||||
Cell x_cell = _x_cellIndex < 0 ? null : row.getCell(_x_cellIndex);
|
||||
Properties x_bindings = ExpressionUtils.createBindings(project);
|
||||
|
@ -82,6 +82,7 @@ public class ExpressionEqualRowFilter implements RowFilter {
|
||||
_invert = invert;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterRow(Project project, int rowIndex, Row row) {
|
||||
return _invert ?
|
||||
internalInvertedFilterRow(project, rowIndex, row) :
|
||||
|
@ -72,6 +72,7 @@ abstract public class ExpressionNumberComparisonRowFilter implements RowFilter {
|
||||
_selectError = selectError;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterRow(Project project, int rowIndex, Row row) {
|
||||
Properties bindings = ExpressionUtils.createBindings(project);
|
||||
|
||||
|
@ -61,6 +61,7 @@ abstract public class ExpressionStringComparisonRowFilter implements RowFilter {
|
||||
_cellIndex = cellIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterRow(Project project, int rowIndex, Row row) {
|
||||
Cell cell = _cellIndex < 0 ? null : row.getCell(_cellIndex);
|
||||
|
||||
|
@ -61,6 +61,7 @@ abstract public class ExpressionTimeComparisonRowFilter extends ExpressionNumber
|
||||
_selectNonTime = selectNonTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkValue(Object v) {
|
||||
if (ExpressionUtils.isError(v)) {
|
||||
return _selectError;
|
||||
@ -77,6 +78,7 @@ abstract public class ExpressionTimeComparisonRowFilter extends ExpressionNumber
|
||||
}
|
||||
|
||||
// not really needed for operation, just to make extending the abstract class possible
|
||||
@Override
|
||||
protected boolean checkValue(double d) {
|
||||
return false;
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ public class ConjunctiveFilteredRows implements FilteredRows {
|
||||
_rowFilters.add(rowFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(Project project, RowVisitor visitor) {
|
||||
try {
|
||||
visitor.start(project);
|
||||
|
@ -101,6 +101,7 @@ public class ExpressionNominalValueGrouper implements RowVisitor, RecordVisitor
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(Project project, int rowIndex, Row row) {
|
||||
hasError = false;
|
||||
hasBlank = false;
|
||||
|
@ -110,6 +110,7 @@ public class BinningClusterer extends Clusterer {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(Project project, int rowIndex, Row row) {
|
||||
Cell cell = row.getCell(_colindex);
|
||||
if (cell != null && cell.value != null) {
|
||||
@ -139,6 +140,7 @@ public class BinningClusterer extends Clusterer {
|
||||
|
||||
public static class SizeComparator implements Comparator<Map<String,Integer>>, Serializable {
|
||||
private static final long serialVersionUID = -1390696157208674054L;
|
||||
@Override
|
||||
public int compare(Map<String,Integer> o1, Map<String,Integer> o2) {
|
||||
int s1 = o1.size();
|
||||
int s2 = o2.size();
|
||||
@ -160,16 +162,19 @@ public class BinningClusterer extends Clusterer {
|
||||
|
||||
public static class EntriesComparator implements Comparator<Entry<String,Integer>>, Serializable {
|
||||
private static final long serialVersionUID = 2763378036791777964L;
|
||||
@Override
|
||||
public int compare(Entry<String,Integer> o1, Entry<String,Integer> o2) {
|
||||
return o2.getValue() - o1.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeFromJSON(Project project, JSONObject o) throws Exception {
|
||||
super.initializeFromJSON(project, o);
|
||||
_keyer = _keyers.get(o.getString("function").toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void computeClusters(Engine engine) {
|
||||
BinningRowVisitor visitor = new BinningRowVisitor(_keyer,_config);
|
||||
FilteredRows filteredRows = engine.getAllFilteredRows();
|
||||
@ -180,6 +185,7 @@ public class BinningClusterer extends Clusterer {
|
||||
Collections.sort(_clusters, new SizeComparator());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options) throws JSONException {
|
||||
EntriesComparator c = new EntriesComparator();
|
||||
|
||||
|
@ -44,6 +44,7 @@ public class DoubleMetaphoneKeyer extends Keyer {
|
||||
_metaphone2.setMaxCodeLen(2000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key(String s, Object... o) {
|
||||
return _metaphone2.doubleMetaphone(s);
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ public class FingerprintKeyer extends Keyer {
|
||||
|
||||
static final Pattern alphanum = Pattern.compile("\\p{Punct}|\\p{Cntrl}");
|
||||
|
||||
@Override
|
||||
public String key(String s, Object... o) {
|
||||
s = s.trim(); // first off, remove whitespace around the string
|
||||
s = s.toLowerCase(); // then lowercase it
|
||||
|
@ -38,6 +38,7 @@ public class Metaphone3Keyer extends Keyer {
|
||||
public Metaphone3Keyer() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key(String s, Object... o) {
|
||||
Metaphone3 _metaphone3 = new Metaphone3();
|
||||
//_metaphone3.SetEncodeVowels(true);
|
||||
|
@ -44,6 +44,7 @@ public class MetaphoneKeyer extends Keyer {
|
||||
_metaphone.setMaxCodeLen(2000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key(String s, Object... o) {
|
||||
return _metaphone.metaphone(s);
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ public class NGramFingerprintKeyer extends FingerprintKeyer {
|
||||
|
||||
static final Pattern alphanum = Pattern.compile("\\p{Punct}|\\p{Cntrl}|\\p{Space}");
|
||||
|
||||
@Override
|
||||
public String key(String s, Object... o) {
|
||||
int ngram_size = 2;
|
||||
if (o != null && o.length > 0 && o[0] instanceof Number) {
|
||||
|
@ -43,6 +43,7 @@ public class SoundexKeyer extends Keyer {
|
||||
_soundex = new Soundex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key(String s, Object... o) {
|
||||
return _soundex.soundex(s);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user