From 123614539de017e88ab37bbf0c406927963df1ca Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Tue, 2 Aug 2011 19:30:23 +0000 Subject: [PATCH] Add missing @Override annotations git-svn-id: http://google-refine.googlecode.com/svn/trunk@2171 7d457c2a-affb-35e4-300a-418c747d4874 --- README.txt | 10 ++++++++-- .../com/google/refine/freebase/FreebaseTopic.java | 1 + .../com/google/refine/freebase/FreebaseType.java | 1 + .../freebase/ProtographTransposeExporter.java | 2 ++ .../commands/auth/CheckAuthorizationCommand.java | 1 + .../google/refine/freebase/expr/MqlKeyQuote.java | 2 ++ .../refine/freebase/expr/MqlKeyUnquote.java | 2 ++ .../model/changes/DataExtensionChange.java | 3 +++ .../model/recon/DataExtensionReconConfig.java | 1 + .../model/recon/GuidBasedReconConfig.java | 2 ++ .../freebase/model/recon/IdBasedReconConfig.java | 2 ++ .../freebase/model/recon/KeyBasedReconConfig.java | 2 ++ .../refine/freebase/oauth/FreebaseProvider.java | 3 +++ .../FreebaseTimeCommonsHttpOAuthConsumer.java | 1 + .../freebase/operations/ExtendDataOperation.java | 7 +++++++ .../operations/ImportQADataOperation.java | 1 + .../operations/SaveProtographOperation.java | 5 +++++ .../refine/freebase/protograph/AnonymousNode.java | 4 ++++ .../refine/freebase/protograph/CellKeyNode.java | 1 + .../refine/freebase/protograph/CellTopicNode.java | 4 ++++ .../refine/freebase/protograph/CellValueNode.java | 1 + .../freebase/protograph/FreebaseTopicNode.java | 4 ++++ .../google/refine/freebase/protograph/Link.java | 1 + .../refine/freebase/protograph/Protograph.java | 1 + .../refine/freebase/protograph/ValueNode.java | 1 + .../MqlwriteLikeTransposedNodeFactory.java | 9 +++++++++ .../TripleLoaderTransposedNodeFactory.java | 10 ++++++++++ .../refine/extension/gdata/AuthorizeCommand.java | 1 + .../refine/extension/gdata/AuthorizeCommand2.java | 1 + .../extension/gdata/DeAuthorizeCommand.java | 1 + .../com/google/refine/jython/JythonEvaluable.java | 2 ++ .../refine/jython/JythonHasFieldsWrapper.java | 1 + .../google/refine/jython/JythonObjectWrapper.java | 1 + main/src/com/google/refine/ProjectManager.java | 1 + main/src/com/google/refine/ProjectMetadata.java | 1 + main/src/com/google/refine/RefineServlet.java | 1 + .../google/refine/browsing/DecoratedValue.java | 1 + main/src/com/google/refine/browsing/Engine.java | 1 + .../refine/clustering/knn/kNNClusterer.java | 6 ++++++ .../refine/commands/cell/EditOneCellCommand.java | 1 + .../commands/recon/GuessTypesOfColumnCommand.java | 1 + .../commands/recon/ReconClearOneCellCommand.java | 1 + .../commands/recon/ReconJudgeOneCellCommand.java | 1 + .../commands/row/AnnotateOneRowCommand.java | 2 ++ .../refine/commands/row/GetRowsCommand.java | 1 + .../com/google/refine/exporters/CsvExporter.java | 1 + .../refine/exporters/HtmlTableExporter.java | 1 + .../com/google/refine/expr/functions/Cross.java | 2 ++ .../google/refine/expr/functions/FacetCount.java | 2 ++ .../src/com/google/refine/expr/functions/Get.java | 2 ++ .../google/refine/expr/functions/HasField.java | 2 ++ .../com/google/refine/expr/functions/Jsonize.java | 2 ++ .../com/google/refine/expr/functions/Length.java | 2 ++ .../com/google/refine/expr/functions/Slice.java | 2 ++ .../com/google/refine/expr/functions/ToDate.java | 2 ++ .../google/refine/expr/functions/ToNumber.java | 2 ++ .../google/refine/expr/functions/ToString.java | 2 ++ .../com/google/refine/expr/functions/Type.java | 2 ++ .../refine/expr/functions/arrays/ArgsToArray.java | 2 ++ .../google/refine/expr/functions/arrays/Join.java | 2 ++ .../refine/expr/functions/arrays/Reverse.java | 2 ++ .../google/refine/expr/functions/arrays/Sort.java | 2 ++ .../refine/expr/functions/arrays/Uniques.java | 2 ++ .../refine/expr/functions/booleans/And.java | 2 ++ .../refine/expr/functions/booleans/Not.java | 2 ++ .../google/refine/expr/functions/booleans/Or.java | 2 ++ .../refine/expr/functions/date/DatePart.java | 2 ++ .../google/refine/expr/functions/date/Inc.java | 2 ++ .../google/refine/expr/functions/date/Now.java | 2 ++ .../refine/expr/functions/html/HtmlAttr.java | 2 ++ .../refine/expr/functions/html/HtmlText.java | 2 ++ .../refine/expr/functions/html/InnerHtml.java | 2 ++ .../refine/expr/functions/html/ParseHtml.java | 2 ++ .../refine/expr/functions/html/SelectHtml.java | 2 ++ .../google/refine/expr/functions/math/ACos.java | 2 ++ .../google/refine/expr/functions/math/ASin.java | 2 ++ .../google/refine/expr/functions/math/ATan.java | 2 ++ .../google/refine/expr/functions/math/ATan2.java | 2 ++ .../google/refine/expr/functions/math/Abs.java | 2 ++ .../google/refine/expr/functions/math/Ceil.java | 2 ++ .../google/refine/expr/functions/math/Combin.java | 2 ++ .../google/refine/expr/functions/math/Cos.java | 2 ++ .../google/refine/expr/functions/math/Cosh.java | 2 ++ .../refine/expr/functions/math/Degrees.java | 2 ++ .../google/refine/expr/functions/math/Even.java | 2 ++ .../google/refine/expr/functions/math/Exp.java | 2 ++ .../google/refine/expr/functions/math/Fact.java | 2 ++ .../google/refine/expr/functions/math/FactN.java | 2 ++ .../google/refine/expr/functions/math/Floor.java | 2 ++ .../functions/math/GreatestCommonDenominator.java | 2 ++ .../expr/functions/math/LeastCommonMultiple.java | 2 ++ .../com/google/refine/expr/functions/math/Ln.java | 2 ++ .../google/refine/expr/functions/math/Log.java | 2 ++ .../google/refine/expr/functions/math/Max.java | 2 ++ .../google/refine/expr/functions/math/Min.java | 2 ++ .../google/refine/expr/functions/math/Mod.java | 2 ++ .../refine/expr/functions/math/Multinomial.java | 2 ++ .../google/refine/expr/functions/math/Odd.java | 2 ++ .../google/refine/expr/functions/math/Pow.java | 2 ++ .../refine/expr/functions/math/Quotient.java | 2 ++ .../refine/expr/functions/math/Radians.java | 2 ++ .../google/refine/expr/functions/math/Round.java | 2 ++ .../google/refine/expr/functions/math/Sin.java | 2 ++ .../google/refine/expr/functions/math/Sinh.java | 2 ++ .../google/refine/expr/functions/math/Sum.java | 2 ++ .../google/refine/expr/functions/math/Tan.java | 2 ++ .../google/refine/expr/functions/math/Tanh.java | 2 ++ .../refine/expr/functions/strings/Chomp.java | 2 ++ .../refine/expr/functions/strings/Contains.java | 2 ++ .../refine/expr/functions/strings/Diff.java | 2 ++ .../refine/expr/functions/strings/EndsWith.java | 2 ++ .../refine/expr/functions/strings/Escape.java | 2 ++ .../expr/functions/strings/Fingerprint.java | 2 ++ .../refine/expr/functions/strings/IndexOf.java | 2 ++ .../expr/functions/strings/LastIndexOf.java | 2 ++ .../google/refine/expr/functions/strings/MD5.java | 2 ++ .../refine/expr/functions/strings/Match.java | 2 ++ .../refine/expr/functions/strings/NGram.java | 2 ++ .../expr/functions/strings/NGramFingerprint.java | 2 ++ .../refine/expr/functions/strings/ParseJson.java | 2 ++ .../refine/expr/functions/strings/Partition.java | 2 ++ .../refine/expr/functions/strings/RPartition.java | 2 ++ .../expr/functions/strings/Reinterpret.java | 2 ++ .../refine/expr/functions/strings/Replace.java | 2 ++ .../expr/functions/strings/ReplaceChars.java | 2 ++ .../refine/expr/functions/strings/SHA1.java | 2 ++ .../refine/expr/functions/strings/SmartSplit.java | 2 ++ .../refine/expr/functions/strings/Split.java | 2 ++ .../expr/functions/strings/SplitByCharType.java | 2 ++ .../expr/functions/strings/SplitByLengths.java | 2 ++ .../refine/expr/functions/strings/StartsWith.java | 2 ++ .../expr/functions/strings/ToLowercase.java | 2 ++ .../expr/functions/strings/ToTitlecase.java | 2 ++ .../expr/functions/strings/ToUppercase.java | 2 ++ .../refine/expr/functions/strings/Trim.java | 2 ++ .../refine/expr/functions/strings/Unescape.java | 2 ++ .../refine/expr/functions/strings/Unicode.java | 2 ++ .../expr/functions/strings/UnicodeType.java | 2 ++ .../google/refine/grel/ast/ControlCallExpr.java | 1 + .../google/refine/grel/ast/FieldAccessorExpr.java | 1 + .../google/refine/grel/ast/FunctionCallExpr.java | 2 ++ .../com/google/refine/grel/ast/LiteralExpr.java | 2 ++ .../com/google/refine/grel/ast/VariableExpr.java | 2 ++ .../com/google/refine/grel/controls/Filter.java | 3 +++ .../com/google/refine/grel/controls/ForEach.java | 3 +++ .../google/refine/grel/controls/ForEachIndex.java | 3 +++ .../google/refine/grel/controls/ForNonBlank.java | 3 +++ .../com/google/refine/grel/controls/ForRange.java | 3 +++ main/src/com/google/refine/grel/controls/If.java | 3 +++ .../com/google/refine/grel/controls/IsTest.java | 3 +++ .../src/com/google/refine/grel/controls/With.java | 3 +++ .../com/google/refine/history/ChangeSequence.java | 3 +++ main/src/com/google/refine/history/History.java | 1 + .../com/google/refine/history/HistoryEntry.java | 1 + .../com/google/refine/history/HistoryProcess.java | 7 +++++++ .../refine/importers/tree/ImportColumnGroup.java | 1 + .../importers/tree/RecordElementCandidate.java | 1 + .../importers/tree/TreeImportUtilities.java | 3 +++ .../refine/importing/ImportingUtilities.java | 2 ++ .../google/refine/io/FileHistoryEntryManager.java | 4 ++++ .../com/google/refine/io/FileProjectManager.java | 6 ++++++ .../google/refine/logging/IndentingLayout.java | 3 +++ main/src/com/google/refine/model/Cell.java | 4 ++++ main/src/com/google/refine/model/ColumnGroup.java | 2 ++ main/src/com/google/refine/model/Recon.java | 5 +++++ .../com/google/refine/model/ReconCandidate.java | 3 +++ main/src/com/google/refine/model/ReconStats.java | 1 + main/src/com/google/refine/model/RecordModel.java | 2 ++ main/src/com/google/refine/model/Row.java | 4 ++++ .../google/refine/model/changes/CellChange.java | 3 +++ .../model/changes/ColumnAdditionChange.java | 3 +++ .../refine/model/changes/ColumnMoveChange.java | 3 +++ .../refine/model/changes/ColumnRemovalChange.java | 3 +++ .../refine/model/changes/ColumnRenameChange.java | 3 +++ .../refine/model/changes/ColumnReorderChange.java | 3 +++ .../refine/model/changes/ColumnSplitChange.java | 3 +++ .../refine/model/changes/MassCellChange.java | 3 +++ .../google/refine/model/changes/MassChange.java | 3 +++ .../refine/model/changes/MassReconChange.java | 3 +++ .../refine/model/changes/MassRowChange.java | 3 +++ .../refine/model/changes/MassRowColumnChange.java | 3 +++ .../google/refine/model/changes/ReconChange.java | 1 + .../refine/model/changes/RowFlagChange.java | 3 +++ .../refine/model/changes/RowRemovalChange.java | 3 +++ .../refine/model/changes/RowReorderChange.java | 3 +++ .../refine/model/changes/RowStarChange.java | 3 +++ .../refine/model/recon/StandardReconConfig.java | 2 ++ main/src/com/google/refine/oauth/Credentials.java | 1 + .../com/google/refine/oauth/GoogleProvider.java | 3 +++ .../EngineDependentMassCellOperation.java | 1 + .../operations/cell/BlankDownOperation.java | 5 +++++ .../refine/operations/cell/FillDownOperation.java | 5 +++++ .../refine/operations/cell/MassEditOperation.java | 6 ++++++ .../cell/MultiValuedCellJoinOperation.java | 3 +++ .../cell/MultiValuedCellSplitOperation.java | 4 +++- .../operations/cell/TextTransformOperation.java | 5 +++++ .../cell/TransposeColumnsIntoRowsOperation.java | 4 +++- .../cell/TransposeRowsIntoColumnsOperation.java | 4 +++- .../ColumnAdditionByFetchingURLsOperation.java | 7 +++++++ .../column/ColumnAdditionOperation.java | 4 ++++ .../operations/column/ColumnMoveOperation.java | 5 ++++- .../operations/column/ColumnRemovalOperation.java | 5 ++++- .../operations/column/ColumnRenameOperation.java | 5 ++++- .../operations/column/ColumnReorderOperation.java | 5 ++++- .../operations/column/ColumnSplitOperation.java | 7 +++++++ .../recon/ReconClearSimilarCellsOperation.java | 6 ++++++ .../recon/ReconCopyAcrossColumnsOperation.java | 5 +++++ .../recon/ReconDiscardJudgmentsOperation.java | 6 ++++++ .../recon/ReconJudgeSimilarCellsOperation.java | 6 ++++++ .../recon/ReconMarkNewTopicsOperation.java | 6 ++++++ .../recon/ReconMatchBestCandidatesOperation.java | 6 ++++++ .../recon/ReconMatchSpecificTopicOperation.java | 6 ++++++ .../refine/operations/recon/ReconOperation.java | 7 +++++++ .../operations/row/DenormalizeOperation.java | 5 ++++- .../refine/operations/row/RowFlagOperation.java | 6 +++++- .../operations/row/RowRemovalOperation.java | 6 +++++- .../operations/row/RowReorderOperation.java | 5 ++++- .../refine/operations/row/RowStarOperation.java | 6 +++++- .../google/refine/process/LongRunningProcess.java | 2 ++ .../com/google/refine/process/ProcessManager.java | 1 + .../refine/process/QuickHistoryEntryProcess.java | 6 ++++++ .../com/google/refine/templating/Template.java | 1 + main/src/com/google/refine/util/Pool.java | 1 + .../google/refine/tests/ProjectManagerTests.java | 1 + .../google/refine/tests/RefineServletTests.java | 1 + .../refine/tests/commands/CommandTests.java | 1 + .../util/CancelProcessesCommandTests.java | 1 + .../refine/tests/exporters/CsvExporterTests.java | 1 + .../refine/tests/exporters/HtmlExporterTests.java | 1 + .../tests/exporters/TemplatingExporterTests.java | 1 + .../refine/tests/exporters/TsvExporterTests.java | 1 + .../refine/tests/exporters/XlsExporterTests.java | 1 + .../google/refine/tests/history/HistoryTests.java | 1 + .../tests/importers/FixedWidthImporterTests.java | 3 +++ .../tests/importers/ImporterUtilitiesTests.java | 1 + .../refine/tests/importers/JsonImporterTests.java | 5 ++++- .../tests/importers/RdfTripleImporterTests.java | 2 ++ .../tests/importers/TsvCsvImporterTests.java | 3 +++ .../tests/importers/XmlImportUtilitiesTests.java | 1 + .../refine/tests/importers/XmlImporterTests.java | 3 +++ .../com/google/refine/tests/model/ReconTests.java | 1 + .../com/google/refine/tests/model/RowTests.java | 1 + .../refine/tests/util/ParsingUtilitiesTests.java | 1 + server/src/com/google/refine/Refine.java | 4 ++++ .../com/google/util/logging/IndentingLayout.java | 3 +++ .../util/threads/ThreadPoolExecutorAdapter.java | 15 +++++++++++++++ 246 files changed, 631 insertions(+), 15 deletions(-) diff --git a/README.txt b/README.txt index cff63992b..3e1f0bdc2 100644 --- a/README.txt +++ b/README.txt @@ -52,8 +52,14 @@ This is the full list of contributors (in chronological order): - Iain Sproat - Tom Morris - Heather Campbell - - + - Thad Guidry + - Paul Makepeace + - Tomaž Šolc + - Gabriel Sjoberg + - Rod Salazar + - pxb + + We welcome additional contributors if you'd like to help out. - o - diff --git a/extensions/freebase/src/com/google/refine/freebase/FreebaseTopic.java b/extensions/freebase/src/com/google/refine/freebase/FreebaseTopic.java index 83c8ea9cd..7744d7482 100644 --- a/extensions/freebase/src/com/google/refine/freebase/FreebaseTopic.java +++ b/extensions/freebase/src/com/google/refine/freebase/FreebaseTopic.java @@ -49,6 +49,7 @@ public class FreebaseTopic implements Jsonizable { this.name = name; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/FreebaseType.java b/extensions/freebase/src/com/google/refine/freebase/FreebaseType.java index 388a374e9..22d4f9aa3 100644 --- a/extensions/freebase/src/com/google/refine/freebase/FreebaseType.java +++ b/extensions/freebase/src/com/google/refine/freebase/FreebaseType.java @@ -46,6 +46,7 @@ public class FreebaseType extends FreebaseTopic implements Jsonizable { super(id, name); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/ProtographTransposeExporter.java b/extensions/freebase/src/com/google/refine/freebase/ProtographTransposeExporter.java index ca0b520be..988ba1a60 100644 --- a/extensions/freebase/src/com/google/refine/freebase/ProtographTransposeExporter.java +++ b/extensions/freebase/src/com/google/refine/freebase/ProtographTransposeExporter.java @@ -54,6 +54,7 @@ abstract public class ProtographTransposeExporter implements WriterExporter { _contentType = contentType; } + @Override public String getContentType() { return "application/x-unknown"; } @@ -67,6 +68,7 @@ abstract public class ProtographTransposeExporter implements WriterExporter { throw new RuntimeException("Not implemented"); } + @Override public void export(Project project, Properties options, Engine engine, Writer writer) throws IOException { diff --git a/extensions/freebase/src/com/google/refine/freebase/commands/auth/CheckAuthorizationCommand.java b/extensions/freebase/src/com/google/refine/freebase/commands/auth/CheckAuthorizationCommand.java index 8700bb835..990f71f1a 100644 --- a/extensions/freebase/src/com/google/refine/freebase/commands/auth/CheckAuthorizationCommand.java +++ b/extensions/freebase/src/com/google/refine/freebase/commands/auth/CheckAuthorizationCommand.java @@ -52,6 +52,7 @@ public class CheckAuthorizationCommand extends Command { final static Logger logger = LoggerFactory.getLogger("check-authorization_command"); + @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { diff --git a/extensions/freebase/src/com/google/refine/freebase/expr/MqlKeyQuote.java b/extensions/freebase/src/com/google/refine/freebase/expr/MqlKeyQuote.java index e4623f304..653e61f66 100644 --- a/extensions/freebase/src/com/google/refine/freebase/expr/MqlKeyQuote.java +++ b/extensions/freebase/src/com/google/refine/freebase/expr/MqlKeyQuote.java @@ -53,6 +53,7 @@ public class MqlKeyQuote implements Function { final static private Pattern fullValidKeyPattern = Pattern.compile(fullValidKey); final static private Pattern keyCharMustQuotePattern = Pattern.compile(keyCharMustQuote); + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { Object o1 = args[0]; @@ -63,6 +64,7 @@ public class MqlKeyQuote implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/expr/MqlKeyUnquote.java b/extensions/freebase/src/com/google/refine/freebase/expr/MqlKeyUnquote.java index 47d98fa31..479c3da77 100644 --- a/extensions/freebase/src/com/google/refine/freebase/expr/MqlKeyUnquote.java +++ b/extensions/freebase/src/com/google/refine/freebase/expr/MqlKeyUnquote.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class MqlKeyUnquote implements Function { final static private Pattern quotedCharPattern = Pattern.compile("\\$([0-9A-Fa-f]{4})"); + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { Object o1 = args[0]; @@ -75,6 +76,7 @@ public class MqlKeyUnquote implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/model/changes/DataExtensionChange.java b/extensions/freebase/src/com/google/refine/freebase/model/changes/DataExtensionChange.java index 40686f468..2c7b09166 100644 --- a/extensions/freebase/src/com/google/refine/freebase/model/changes/DataExtensionChange.java +++ b/extensions/freebase/src/com/google/refine/freebase/model/changes/DataExtensionChange.java @@ -126,6 +126,7 @@ public class DataExtensionChange implements Change { _newRows = newRows; } + @Override public void apply(Project project) { synchronized (project) { if (_firstNewCellIndex < 0) { @@ -257,6 +258,7 @@ public class DataExtensionChange implements Change { } } + @Override public void revert(Project project) { synchronized (project) { project.rows.clear(); @@ -270,6 +272,7 @@ public class DataExtensionChange implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("baseColumnName="); writer.write(_baseColumnName); writer.write('\n'); writer.write("columnInsertIndex="); writer.write(Integer.toString(_columnInsertIndex)); writer.write('\n'); diff --git a/extensions/freebase/src/com/google/refine/freebase/model/recon/DataExtensionReconConfig.java b/extensions/freebase/src/com/google/refine/freebase/model/recon/DataExtensionReconConfig.java index eb966617d..9ba010ba9 100644 --- a/extensions/freebase/src/com/google/refine/freebase/model/recon/DataExtensionReconConfig.java +++ b/extensions/freebase/src/com/google/refine/freebase/model/recon/DataExtensionReconConfig.java @@ -80,6 +80,7 @@ public class DataExtensionReconConfig extends StrictReconConfig { throw new RuntimeException(WARN); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); writer.key("mode"); writer.value("extend"); diff --git a/extensions/freebase/src/com/google/refine/freebase/model/recon/GuidBasedReconConfig.java b/extensions/freebase/src/com/google/refine/freebase/model/recon/GuidBasedReconConfig.java index b707b474b..938fdcab5 100644 --- a/extensions/freebase/src/com/google/refine/freebase/model/recon/GuidBasedReconConfig.java +++ b/extensions/freebase/src/com/google/refine/freebase/model/recon/GuidBasedReconConfig.java @@ -69,6 +69,7 @@ public class GuidBasedReconConfig extends StrictReconConfig { static protected class GuidBasedReconJob extends ReconJob { String guid; + @Override public int getKey() { return guid.hashCode(); } @@ -102,6 +103,7 @@ public class GuidBasedReconConfig extends StrictReconConfig { return "Reconcile cells in column " + columnName + " as Freebase IDs"; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/model/recon/IdBasedReconConfig.java b/extensions/freebase/src/com/google/refine/freebase/model/recon/IdBasedReconConfig.java index 75fea3e6a..2416b3a94 100644 --- a/extensions/freebase/src/com/google/refine/freebase/model/recon/IdBasedReconConfig.java +++ b/extensions/freebase/src/com/google/refine/freebase/model/recon/IdBasedReconConfig.java @@ -69,6 +69,7 @@ public class IdBasedReconConfig extends StrictReconConfig { static protected class IdBasedReconJob extends ReconJob { String id; + @Override public int getKey() { return id.hashCode(); } @@ -106,6 +107,7 @@ public class IdBasedReconConfig extends StrictReconConfig { return "Reconcile cells in column " + columnName + " as Freebase IDs"; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/model/recon/KeyBasedReconConfig.java b/extensions/freebase/src/com/google/refine/freebase/model/recon/KeyBasedReconConfig.java index 3daccad9f..0fb58de1d 100644 --- a/extensions/freebase/src/com/google/refine/freebase/model/recon/KeyBasedReconConfig.java +++ b/extensions/freebase/src/com/google/refine/freebase/model/recon/KeyBasedReconConfig.java @@ -80,6 +80,7 @@ public class KeyBasedReconConfig extends StrictReconConfig { static protected class KeyBasedReconJob extends ReconJob { String key; + @Override public int getKey() { return key.hashCode(); } @@ -106,6 +107,7 @@ public class KeyBasedReconConfig extends StrictReconConfig { return "Reconcile cells in column " + columnName + " to topics with keys in namespace " + namespace.id; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/oauth/FreebaseProvider.java b/extensions/freebase/src/com/google/refine/freebase/oauth/FreebaseProvider.java index 6b0dee923..69328e946 100644 --- a/extensions/freebase/src/com/google/refine/freebase/oauth/FreebaseProvider.java +++ b/extensions/freebase/src/com/google/refine/freebase/oauth/FreebaseProvider.java @@ -50,14 +50,17 @@ public class FreebaseProvider extends Provider { super(host); } + @Override public String getRequestTokenServiceURL() { return "https://" + host + "/api/oauth/request_token"; } + @Override public String getAccessTokenServiceURL() { return "https://" + host + "/api/oauth/access_token"; } + @Override public String getUserAuthorizationURL() { return "https://" + host + "/signin/app"; } diff --git a/extensions/freebase/src/com/google/refine/freebase/oauth/FreebaseTimeCommonsHttpOAuthConsumer.java b/extensions/freebase/src/com/google/refine/freebase/oauth/FreebaseTimeCommonsHttpOAuthConsumer.java index 8bbcda515..54ab63afc 100644 --- a/extensions/freebase/src/com/google/refine/freebase/oauth/FreebaseTimeCommonsHttpOAuthConsumer.java +++ b/extensions/freebase/src/com/google/refine/freebase/oauth/FreebaseTimeCommonsHttpOAuthConsumer.java @@ -72,6 +72,7 @@ public class FreebaseTimeCommonsHttpOAuthConsumer extends CommonsHttpOAuthConsum * NOTE: this call is potentially vulnerable to a man-in-the-middle (MITM) attack, but the same * could be said if we used an NTP client. */ + @Override protected String generateTimestamp() { long time = -1; diff --git a/extensions/freebase/src/com/google/refine/freebase/operations/ExtendDataOperation.java b/extensions/freebase/src/com/google/refine/freebase/operations/ExtendDataOperation.java index ea4a27837..29e5284de 100644 --- a/extensions/freebase/src/com/google/refine/freebase/operations/ExtendDataOperation.java +++ b/extensions/freebase/src/com/google/refine/freebase/operations/ExtendDataOperation.java @@ -96,6 +96,7 @@ public class ExtendDataOperation extends EngineDependentOperation { _columnInsertIndex = columnInsertIndex; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -109,6 +110,7 @@ public class ExtendDataOperation extends EngineDependentOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Extend data at index " + _columnInsertIndex + " based on column " + _baseColumnName; @@ -120,6 +122,7 @@ public class ExtendDataOperation extends EngineDependentOperation { " by filling " + cellsAtRows.size(); } + @Override public Process createProcess(Project project, Properties options) throws Exception { return new ExtendDataProcess( project, @@ -148,6 +151,7 @@ public class ExtendDataOperation extends EngineDependentOperation { _job = new FreebaseDataExtensionJob(_extension); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -160,6 +164,7 @@ public class ExtendDataOperation extends EngineDependentOperation { writer.endObject(); } + @Override protected Runnable getRunnable() { return this; } @@ -194,6 +199,7 @@ public class ExtendDataOperation extends EngineDependentOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(_cellIndex); if (cell != null && cell.recon != null && cell.recon.match != null) { @@ -246,6 +252,7 @@ public class ExtendDataOperation extends EngineDependentOperation { return end; } + @Override public void run() { List rowIndices = new ArrayList(); List dataExtensions = new ArrayList(); diff --git a/extensions/freebase/src/com/google/refine/freebase/operations/ImportQADataOperation.java b/extensions/freebase/src/com/google/refine/freebase/operations/ImportQADataOperation.java index 781fb1b69..10097f5c3 100644 --- a/extensions/freebase/src/com/google/refine/freebase/operations/ImportQADataOperation.java +++ b/extensions/freebase/src/com/google/refine/freebase/operations/ImportQADataOperation.java @@ -64,6 +64,7 @@ public class ImportQADataOperation extends AbstractOperation { public ImportQADataOperation() { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/operations/SaveProtographOperation.java b/extensions/freebase/src/com/google/refine/freebase/operations/SaveProtographOperation.java index 55fc2603e..b48b15e46 100644 --- a/extensions/freebase/src/com/google/refine/freebase/operations/SaveProtographOperation.java +++ b/extensions/freebase/src/com/google/refine/freebase/operations/SaveProtographOperation.java @@ -64,6 +64,7 @@ public class SaveProtographOperation extends AbstractOperation { _protograph = protograph; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -74,6 +75,7 @@ public class SaveProtographOperation extends AbstractOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Save schema alignment skeleton"; } @@ -93,6 +95,7 @@ public class SaveProtographOperation extends AbstractOperation { _newProtograph = protograph; } + @Override public void apply(Project project) { synchronized (project) { _oldProtograph = (Protograph) project.overlayModels.get("freebaseProtograph"); @@ -101,6 +104,7 @@ public class SaveProtographOperation extends AbstractOperation { } } + @Override public void revert(Project project) { synchronized (project) { if (_oldProtograph == null) { @@ -111,6 +115,7 @@ public class SaveProtographOperation extends AbstractOperation { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("newProtograph="); writeProtograph(_newProtograph, writer); writer.write('\n'); writer.write("oldProtograph="); writeProtograph(_oldProtograph, writer); writer.write('\n'); diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/AnonymousNode.java b/extensions/freebase/src/com/google/refine/freebase/protograph/AnonymousNode.java index 2b707c3cd..b09b32303 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/AnonymousNode.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/AnonymousNode.java @@ -50,6 +50,7 @@ public class AnonymousNode implements Node, NodeWithLinks { this.type = type; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -66,14 +67,17 @@ public class AnonymousNode implements Node, NodeWithLinks { writer.endObject(); } + @Override public void addLink(Link link) { links.add(link); } + @Override public Link getLink(int index) { return links.get(index); } + @Override public int getLinkCount() { return links.size(); } diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/CellKeyNode.java b/extensions/freebase/src/com/google/refine/freebase/protograph/CellKeyNode.java index c1cc82e9f..ed4537571 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/CellKeyNode.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/CellKeyNode.java @@ -49,6 +49,7 @@ public class CellKeyNode extends CellNode { this.namespace = namespace; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/CellTopicNode.java b/extensions/freebase/src/com/google/refine/freebase/protograph/CellTopicNode.java index 8f3f943d2..f90ff58fb 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/CellTopicNode.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/CellTopicNode.java @@ -52,6 +52,7 @@ public class CellTopicNode extends CellNode implements NodeWithLinks { this.type = type; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -77,14 +78,17 @@ public class CellTopicNode extends CellNode implements NodeWithLinks { writer.endObject(); } + @Override public void addLink(Link link) { links.add(link); } + @Override public Link getLink(int index) { return links.get(index); } + @Override public int getLinkCount() { return links.size(); } diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/CellValueNode.java b/extensions/freebase/src/com/google/refine/freebase/protograph/CellValueNode.java index 2a3ebd1e5..0a7ec7ee6 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/CellValueNode.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/CellValueNode.java @@ -50,6 +50,7 @@ public class CellValueNode extends CellNode { this.lang = lang; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/FreebaseTopicNode.java b/extensions/freebase/src/com/google/refine/freebase/protograph/FreebaseTopicNode.java index aeda2beeb..bf74495ee 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/FreebaseTopicNode.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/FreebaseTopicNode.java @@ -50,6 +50,7 @@ public class FreebaseTopicNode implements Node, NodeWithLinks { this.topic = topic; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -67,14 +68,17 @@ public class FreebaseTopicNode implements Node, NodeWithLinks { writer.endObject(); } + @Override public void addLink(Link link) { links.add(link); } + @Override public Link getLink(int index) { return links.get(index); } + @Override public int getLinkCount() { return links.size(); } diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/Link.java b/extensions/freebase/src/com/google/refine/freebase/protograph/Link.java index 13a78eaa2..bfe9aa801 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/Link.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/Link.java @@ -62,6 +62,7 @@ public class Link implements Jsonizable { return target; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/Protograph.java b/extensions/freebase/src/com/google/refine/freebase/protograph/Protograph.java index 68d5b85be..ab11faee7 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/Protograph.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/Protograph.java @@ -186,6 +186,7 @@ public class Protograph implements OverlayModel { ); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); writer.key("rootNodes"); writer.array(); diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/ValueNode.java b/extensions/freebase/src/com/google/refine/freebase/protograph/ValueNode.java index 72db9dcd3..d8befdafa 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/ValueNode.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/ValueNode.java @@ -49,6 +49,7 @@ public class ValueNode implements Node { this.lang = lang; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/transpose/MqlwriteLikeTransposedNodeFactory.java b/extensions/freebase/src/com/google/refine/freebase/protograph/transpose/MqlwriteLikeTransposedNodeFactory.java index 5b18a5bea..16787a021 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/transpose/MqlwriteLikeTransposedNodeFactory.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/transpose/MqlwriteLikeTransposedNodeFactory.java @@ -102,6 +102,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory protected JSONObject obj; + @Override public Object getJSON() { return getJSONObject(); } @@ -122,6 +123,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory this.node = node; } + @Override public JSONObject getJSONObject() { if (obj == null) { obj = new JSONObject(); @@ -182,6 +184,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory this.cell = cell; } + @Override public Object getJSON() { if (obj == null) { obj = new JSONObject(); @@ -212,6 +215,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory this.cell = cell; } + @Override public Object getJSON() { if (obj == null) { obj = new JSONObject(); @@ -260,6 +264,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory this.node = node; } + @Override public Object getJSON() { if (obj == null) { obj = new JSONObject(); @@ -278,6 +283,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory return obj; } } + @Override public TransposedNode transposeAnonymousNode( TransposedNode parentNode, Link link, @@ -290,6 +296,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory ); } + @Override public TransposedNode transposeCellNode( TransposedNode parentNode, Link link, @@ -313,6 +320,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory return tnode; } + @Override public TransposedNode transposeTopicNode( TransposedNode parentNode, Link link, @@ -325,6 +333,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory return tnode; } + @Override public TransposedNode transposeValueNode( TransposedNode parentNode, Link link, diff --git a/extensions/freebase/src/com/google/refine/freebase/protograph/transpose/TripleLoaderTransposedNodeFactory.java b/extensions/freebase/src/com/google/refine/freebase/protograph/transpose/TripleLoaderTransposedNodeFactory.java index 186448ad5..8a9618c04 100644 --- a/extensions/freebase/src/com/google/refine/freebase/protograph/transpose/TripleLoaderTransposedNodeFactory.java +++ b/extensions/freebase/src/com/google/refine/freebase/protograph/transpose/TripleLoaderTransposedNodeFactory.java @@ -349,6 +349,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory //protected AnonymousTransposedNode(AnonymousNode node) { } + @Override public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) { if (children.size() == 0 || subject == null) { return null; @@ -431,6 +432,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory this.cell = cell; } + @Override public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) { String id = null; if (cell.recon != null && cell.recon.judgment != Recon.Judgment.None) { @@ -505,6 +507,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory this.cell = cell; } + @Override public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) { Object value = cell.value; if (value != null) { @@ -541,6 +544,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory this.cell = cell; } + @Override public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) { writeLine(subject, "key", node.namespace.id + "/" + cell.value, project, subjectRowIndex, subjectCellIndex, subjectCell, @@ -557,6 +561,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory this.node = node; } + @Override public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) { writeLine(subject, predicate, node.topic.id, project, subjectRowIndex, subjectCellIndex, subjectCell, @@ -575,6 +580,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory this.node = node; } + @Override public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) { Object value = node.value; if (value != null) { @@ -597,6 +603,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory } } + @Override public TransposedNode transposeAnonymousNode( TransposedNode parentNode, Link link, @@ -620,6 +627,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory return tnode; } + @Override public TransposedNode transposeCellNode( TransposedNode parentNode, Link link, @@ -662,6 +670,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory return tnode; } + @Override public TransposedNode transposeTopicNode( TransposedNode parentNode, Link link, @@ -686,6 +695,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory return tnode; } + @Override public TransposedNode transposeValueNode( TransposedNode parentNode, Link link, diff --git a/extensions/gdata/src/com/google/refine/extension/gdata/AuthorizeCommand.java b/extensions/gdata/src/com/google/refine/extension/gdata/AuthorizeCommand.java index 19dd7f1b5..e1ebefb27 100644 --- a/extensions/gdata/src/com/google/refine/extension/gdata/AuthorizeCommand.java +++ b/extensions/gdata/src/com/google/refine/extension/gdata/AuthorizeCommand.java @@ -15,6 +15,7 @@ import com.google.refine.commands.Command; */ public class AuthorizeCommand extends Command { + @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { diff --git a/extensions/gdata/src/com/google/refine/extension/gdata/AuthorizeCommand2.java b/extensions/gdata/src/com/google/refine/extension/gdata/AuthorizeCommand2.java index fdddbe4c2..fe98d038f 100644 --- a/extensions/gdata/src/com/google/refine/extension/gdata/AuthorizeCommand2.java +++ b/extensions/gdata/src/com/google/refine/extension/gdata/AuthorizeCommand2.java @@ -16,6 +16,7 @@ import com.google.refine.commands.Command; */ public class AuthorizeCommand2 extends Command { + @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { diff --git a/extensions/gdata/src/com/google/refine/extension/gdata/DeAuthorizeCommand.java b/extensions/gdata/src/com/google/refine/extension/gdata/DeAuthorizeCommand.java index a2e949e40..e05ca70f9 100644 --- a/extensions/gdata/src/com/google/refine/extension/gdata/DeAuthorizeCommand.java +++ b/extensions/gdata/src/com/google/refine/extension/gdata/DeAuthorizeCommand.java @@ -11,6 +11,7 @@ import com.google.refine.commands.Command; public class DeAuthorizeCommand extends Command { + @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { diff --git a/extensions/jython/src/com/google/refine/jython/JythonEvaluable.java b/extensions/jython/src/com/google/refine/jython/JythonEvaluable.java index df7f4f03d..dad9d0d55 100644 --- a/extensions/jython/src/com/google/refine/jython/JythonEvaluable.java +++ b/extensions/jython/src/com/google/refine/jython/JythonEvaluable.java @@ -58,6 +58,7 @@ public class JythonEvaluable implements Evaluable { static public LanguageSpecificParser createParser() { return new LanguageSpecificParser() { + @Override public Evaluable parse(String s) throws ParsingException { return new JythonEvaluable(s); } @@ -108,6 +109,7 @@ public class JythonEvaluable implements Evaluable { _engine.exec(sb.toString()); } + @Override public Object evaluate(Properties bindings) { try { // call the temporary PyFunction directly diff --git a/extensions/jython/src/com/google/refine/jython/JythonHasFieldsWrapper.java b/extensions/jython/src/com/google/refine/jython/JythonHasFieldsWrapper.java index e7bbcfd22..55b49207c 100644 --- a/extensions/jython/src/com/google/refine/jython/JythonHasFieldsWrapper.java +++ b/extensions/jython/src/com/google/refine/jython/JythonHasFieldsWrapper.java @@ -52,6 +52,7 @@ public class JythonHasFieldsWrapper extends PyObject { _bindings = bindings; } + @Override public PyObject __finditem__(PyObject key) { String k = (String) key.__tojava__(String.class); Object v = _obj.getField(k, _bindings); diff --git a/extensions/jython/src/com/google/refine/jython/JythonObjectWrapper.java b/extensions/jython/src/com/google/refine/jython/JythonObjectWrapper.java index df2b5a989..48b3832a3 100644 --- a/extensions/jython/src/com/google/refine/jython/JythonObjectWrapper.java +++ b/extensions/jython/src/com/google/refine/jython/JythonObjectWrapper.java @@ -44,6 +44,7 @@ public class JythonObjectWrapper extends PyObject { _obj = obj; } + @Override public String toString() { return _obj.getClass().getSimpleName(); } diff --git a/main/src/com/google/refine/ProjectManager.java b/main/src/com/google/refine/ProjectManager.java index fc3e405de..81433da24 100644 --- a/main/src/com/google/refine/ProjectManager.java +++ b/main/src/com/google/refine/ProjectManager.java @@ -268,6 +268,7 @@ public abstract class ProjectManager { if (records.size() > 0) { Collections.sort(records, new Comparator() { + @Override public int compare(SaveRecord o1, SaveRecord o2) { if (o1.overdue < o2.overdue) { return 1; diff --git a/main/src/com/google/refine/ProjectMetadata.java b/main/src/com/google/refine/ProjectMetadata.java index d37ad9490..791b5342b 100644 --- a/main/src/com/google/refine/ProjectMetadata.java +++ b/main/src/com/google/refine/ProjectMetadata.java @@ -76,6 +76,7 @@ public class ProjectMetadata implements Jsonizable { preparePreferenceStore(_preferenceStore); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/RefineServlet.java b/main/src/com/google/refine/RefineServlet.java index b7517e871..53f075ffb 100644 --- a/main/src/com/google/refine/RefineServlet.java +++ b/main/src/com/google/refine/RefineServlet.java @@ -83,6 +83,7 @@ public class RefineServlet extends Butterfly { static final protected long s_autoSavePeriod = 1000 * 60 * 5; // 5 minutes static protected class AutoSaveTimerTask extends TimerTask { + @Override public void run() { try { ProjectManager.singleton.save(false); // quick, potentially incomplete save diff --git a/main/src/com/google/refine/browsing/DecoratedValue.java b/main/src/com/google/refine/browsing/DecoratedValue.java index 3bd0e1d14..398d8cb34 100644 --- a/main/src/com/google/refine/browsing/DecoratedValue.java +++ b/main/src/com/google/refine/browsing/DecoratedValue.java @@ -56,6 +56,7 @@ public class DecoratedValue implements Jsonizable { this.label = label; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); diff --git a/main/src/com/google/refine/browsing/Engine.java b/main/src/com/google/refine/browsing/Engine.java index ee5997f1d..8393b6428 100644 --- a/main/src/com/google/refine/browsing/Engine.java +++ b/main/src/com/google/refine/browsing/Engine.java @@ -231,6 +231,7 @@ public class Engine implements Jsonizable { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/clustering/knn/kNNClusterer.java b/main/src/com/google/refine/clustering/knn/kNNClusterer.java index d52666ea7..a909d5561 100644 --- a/main/src/com/google/refine/clustering/knn/kNNClusterer.java +++ b/main/src/com/google/refine/clustering/knn/kNNClusterer.java @@ -123,6 +123,7 @@ public class kNNClusterer 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) { @@ -174,6 +175,7 @@ public class kNNClusterer 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) { @@ -190,11 +192,13 @@ public class kNNClusterer extends Clusterer { } } + @Override public void initializeFromJSON(Project project, JSONObject o) throws Exception { super.initializeFromJSON(project, o); _distance = _distances.get(o.getString("function").toLowerCase()); } + @Override public void computeClusters(Engine engine) { //VPTreeClusteringRowVisitor visitor = new VPTreeClusteringRowVisitor(_distance,_config); BlockingClusteringRowVisitor visitor = new BlockingClusteringRowVisitor(_distance,_config); @@ -206,11 +210,13 @@ public class kNNClusterer extends Clusterer { public static class ValuesComparator implements Comparator>, Serializable { private static final long serialVersionUID = 204469656070583155L; + @Override public int compare(Entry o1, Entry o2) { return o2.getValue() - o1.getValue(); } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { writer.array(); for (Set m : _clusters) { diff --git a/main/src/com/google/refine/commands/cell/EditOneCellCommand.java b/main/src/com/google/refine/commands/cell/EditOneCellCommand.java index f4ea72d97..266319947 100644 --- a/main/src/com/google/refine/commands/cell/EditOneCellCommand.java +++ b/main/src/com/google/refine/commands/cell/EditOneCellCommand.java @@ -136,6 +136,7 @@ public class EditOneCellCommand extends Command { this.value = value; } + @Override protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { Cell cell = _project.rows.get(rowIndex).getCell(cellIndex); Column column = _project.columnModel.getColumnByCellIndex(cellIndex); diff --git a/main/src/com/google/refine/commands/recon/GuessTypesOfColumnCommand.java b/main/src/com/google/refine/commands/recon/GuessTypesOfColumnCommand.java index 35477050a..5ce6f234e 100644 --- a/main/src/com/google/refine/commands/recon/GuessTypesOfColumnCommand.java +++ b/main/src/com/google/refine/commands/recon/GuessTypesOfColumnCommand.java @@ -243,6 +243,7 @@ public class GuessTypesOfColumnCommand extends Command { List types = new ArrayList(map.values()); Collections.sort(types, new Comparator() { + @Override public int compare(TypeGroup o1, TypeGroup o2) { int c = Math.min(s_sampleSize, o2.count) - Math.min(s_sampleSize, o1.count); if (c != 0) { diff --git a/main/src/com/google/refine/commands/recon/ReconClearOneCellCommand.java b/main/src/com/google/refine/commands/recon/ReconClearOneCellCommand.java index f95fc6bfa..5715b47f0 100644 --- a/main/src/com/google/refine/commands/recon/ReconClearOneCellCommand.java +++ b/main/src/com/google/refine/commands/recon/ReconClearOneCellCommand.java @@ -118,6 +118,7 @@ public class ReconClearOneCellCommand extends Command { this.cellIndex = cellIndex; } + @Override protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { Cell cell = _project.rows.get(rowIndex).getCell(cellIndex); if (cell == null || !ExpressionUtils.isNonBlankData(cell.value)) { diff --git a/main/src/com/google/refine/commands/recon/ReconJudgeOneCellCommand.java b/main/src/com/google/refine/commands/recon/ReconJudgeOneCellCommand.java index af0b65d04..8c32f1965 100644 --- a/main/src/com/google/refine/commands/recon/ReconJudgeOneCellCommand.java +++ b/main/src/com/google/refine/commands/recon/ReconJudgeOneCellCommand.java @@ -154,6 +154,7 @@ public class ReconJudgeOneCellCommand extends Command { this.schemaSpace = schemaSpace; } + @Override protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { Cell cell = _project.rows.get(rowIndex).getCell(cellIndex); if (cell == null || !ExpressionUtils.isNonBlankData(cell.value)) { diff --git a/main/src/com/google/refine/commands/row/AnnotateOneRowCommand.java b/main/src/com/google/refine/commands/row/AnnotateOneRowCommand.java index e4bc8a937..6555f8b47 100644 --- a/main/src/com/google/refine/commands/row/AnnotateOneRowCommand.java +++ b/main/src/com/google/refine/commands/row/AnnotateOneRowCommand.java @@ -114,6 +114,7 @@ public class AnnotateOneRowCommand extends Command { this.starred = starred; } + @Override protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { return new HistoryEntry( historyEntryID, @@ -140,6 +141,7 @@ public class AnnotateOneRowCommand extends Command { this.flagged = flagged; } + @Override protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { return new HistoryEntry( historyEntryID, diff --git a/main/src/com/google/refine/commands/row/GetRowsCommand.java b/main/src/com/google/refine/commands/row/GetRowsCommand.java index 3edb379c3..8a8ca74dc 100644 --- a/main/src/com/google/refine/commands/row/GetRowsCommand.java +++ b/main/src/com/google/refine/commands/row/GetRowsCommand.java @@ -208,6 +208,7 @@ public class GetRowsCommand extends Command { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { if (total >= start && total < start + limit) { internalVisit(project, rowIndex, row); diff --git a/main/src/com/google/refine/exporters/CsvExporter.java b/main/src/com/google/refine/exporters/CsvExporter.java index cf3a146e0..b3563bb7e 100644 --- a/main/src/com/google/refine/exporters/CsvExporter.java +++ b/main/src/com/google/refine/exporters/CsvExporter.java @@ -84,6 +84,7 @@ public class CsvExporter implements WriterExporter{ return this; } + @Override public boolean visit(Project project, int rowIndex, Row row) { int size = project.columnModel.columns.size(); diff --git a/main/src/com/google/refine/exporters/HtmlTableExporter.java b/main/src/com/google/refine/exporters/HtmlTableExporter.java index 7f7cdffd2..3e99391be 100644 --- a/main/src/com/google/refine/exporters/HtmlTableExporter.java +++ b/main/src/com/google/refine/exporters/HtmlTableExporter.java @@ -92,6 +92,7 @@ public class HtmlTableExporter implements WriterExporter { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { try { writer.write(""); diff --git a/main/src/com/google/refine/expr/functions/Cross.java b/main/src/com/google/refine/expr/functions/Cross.java index fe026a235..d4a3e484c 100644 --- a/main/src/com/google/refine/expr/functions/Cross.java +++ b/main/src/com/google/refine/expr/functions/Cross.java @@ -48,6 +48,7 @@ import com.google.refine.model.Project; public class Cross implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 3) { // from project is implied @@ -74,6 +75,7 @@ public class Cross implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a cell, a project name to join with, and a column name in that project"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/FacetCount.java b/main/src/com/google/refine/expr/functions/FacetCount.java index 09137f26b..3fe874f11 100644 --- a/main/src/com/google/refine/expr/functions/FacetCount.java +++ b/main/src/com/google/refine/expr/functions/FacetCount.java @@ -51,6 +51,7 @@ import com.google.refine.model.Project; public class FacetCount implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 3 && args[1] instanceof String && args[2] instanceof String) { Object choiceValue = args[0]; // choice value to look up @@ -85,6 +86,7 @@ public class FacetCount implements Function { " expects a choice value, an expression as a string, and a column name"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/Get.java b/main/src/com/google/refine/expr/functions/Get.java index 5ed2c4a3a..2cc9540be 100644 --- a/main/src/com/google/refine/expr/functions/Get.java +++ b/main/src/com/google/refine/expr/functions/Get.java @@ -48,6 +48,7 @@ import com.google.refine.grel.Function; public class Get implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length > 1 && args.length <= 3) { Object v = args[0]; @@ -164,6 +165,7 @@ public class Get implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/HasField.java b/main/src/com/google/refine/expr/functions/HasField.java index b9f51445a..25f8f32e9 100644 --- a/main/src/com/google/refine/expr/functions/HasField.java +++ b/main/src/com/google/refine/expr/functions/HasField.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class HasField implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length > 1 && args.length <= 2) { Object v = args[0]; @@ -65,6 +66,7 @@ public class HasField implements Function { return false; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/Jsonize.java b/main/src/com/google/refine/expr/functions/Jsonize.java index 68db3ba88..02d4c5f8e 100644 --- a/main/src/com/google/refine/expr/functions/Jsonize.java +++ b/main/src/com/google/refine/expr/functions/Jsonize.java @@ -46,6 +46,7 @@ import com.google.refine.grel.Function; public class Jsonize implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 1) { try { @@ -77,6 +78,7 @@ public class Jsonize implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/Length.java b/main/src/com/google/refine/expr/functions/Length.java index abd596886..bbe7c3a88 100644 --- a/main/src/com/google/refine/expr/functions/Length.java +++ b/main/src/com/google/refine/expr/functions/Length.java @@ -47,6 +47,7 @@ import com.google.refine.grel.Function; public class Length implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { Object v = args[0]; @@ -70,6 +71,7 @@ public class Length implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array or a string"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/Slice.java b/main/src/com/google/refine/expr/functions/Slice.java index c83de6ae2..3418ac24b 100644 --- a/main/src/com/google/refine/expr/functions/Slice.java +++ b/main/src/com/google/refine/expr/functions/Slice.java @@ -46,6 +46,7 @@ import com.google.refine.grel.Function; public class Slice implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length > 1 && args.length <= 3) { Object v = args[0]; @@ -128,6 +129,7 @@ public class Slice implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/ToDate.java b/main/src/com/google/refine/expr/functions/ToDate.java index 0367019cb..24580148e 100644 --- a/main/src/com/google/refine/expr/functions/ToDate.java +++ b/main/src/com/google/refine/expr/functions/ToDate.java @@ -47,6 +47,7 @@ import com.google.refine.grel.Function; public class ToDate implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 0) { // missing value, can this happen? @@ -98,6 +99,7 @@ public class ToDate implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/ToNumber.java b/main/src/com/google/refine/expr/functions/ToNumber.java index dc3cada36..82ebaafe5 100644 --- a/main/src/com/google/refine/expr/functions/ToNumber.java +++ b/main/src/com/google/refine/expr/functions/ToNumber.java @@ -43,6 +43,7 @@ import com.google.refine.grel.Function; public class ToNumber implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null) { if (args[0] instanceof Number) { @@ -59,6 +60,7 @@ public class ToNumber implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/ToString.java b/main/src/com/google/refine/expr/functions/ToString.java index ef66de616..f10c9b240 100644 --- a/main/src/com/google/refine/expr/functions/ToString.java +++ b/main/src/com/google/refine/expr/functions/ToString.java @@ -46,6 +46,7 @@ import com.google.refine.grel.Function; public class ToString implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 1) { Object o1 = args[0]; @@ -71,6 +72,7 @@ public class ToString implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/Type.java b/main/src/com/google/refine/expr/functions/Type.java index 84289ade2..f23000120 100644 --- a/main/src/com/google/refine/expr/functions/Type.java +++ b/main/src/com/google/refine/expr/functions/Type.java @@ -47,6 +47,7 @@ import com.google.refine.grel.Function; public class Type implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { Object v = args[0]; @@ -71,6 +72,7 @@ public class Type implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects one argument"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/arrays/ArgsToArray.java b/main/src/com/google/refine/expr/functions/arrays/ArgsToArray.java index 551ad8241..d4eff6781 100644 --- a/main/src/com/google/refine/expr/functions/arrays/ArgsToArray.java +++ b/main/src/com/google/refine/expr/functions/arrays/ArgsToArray.java @@ -42,10 +42,12 @@ import com.google.refine.grel.Function; public class ArgsToArray implements Function { + @Override public Object call(Properties bindings, Object[] args) { return args; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/arrays/Join.java b/main/src/com/google/refine/expr/functions/arrays/Join.java index 5b7fbf273..2930b27a1 100644 --- a/main/src/com/google/refine/expr/functions/arrays/Join.java +++ b/main/src/com/google/refine/expr/functions/arrays/Join.java @@ -47,6 +47,7 @@ import com.google.refine.grel.Function; public class Join implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object v = args[0]; @@ -99,6 +100,7 @@ public class Join implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array and a string"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/arrays/Reverse.java b/main/src/com/google/refine/expr/functions/arrays/Reverse.java index d82185d55..be0a3289e 100644 --- a/main/src/com/google/refine/expr/functions/arrays/Reverse.java +++ b/main/src/com/google/refine/expr/functions/arrays/Reverse.java @@ -48,6 +48,7 @@ import com.google.refine.util.JSONUtilities; public class Reverse implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { Object v = args[0]; @@ -86,6 +87,7 @@ public class Reverse implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/arrays/Sort.java b/main/src/com/google/refine/expr/functions/arrays/Sort.java index 35b7fa7fe..de52ea7dd 100644 --- a/main/src/com/google/refine/expr/functions/arrays/Sort.java +++ b/main/src/com/google/refine/expr/functions/arrays/Sort.java @@ -49,6 +49,7 @@ import com.google.refine.util.JSONUtilities; public class Sort implements Function { + @Override @SuppressWarnings("unchecked") public Object call(Properties bindings, Object[] args) { if (args.length == 1) { @@ -84,6 +85,7 @@ public class Sort implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/arrays/Uniques.java b/main/src/com/google/refine/expr/functions/arrays/Uniques.java index 808934430..810e3df4f 100644 --- a/main/src/com/google/refine/expr/functions/arrays/Uniques.java +++ b/main/src/com/google/refine/expr/functions/arrays/Uniques.java @@ -50,6 +50,7 @@ import com.google.refine.util.JSONUtilities; public class Uniques implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { Object v = args[0]; @@ -84,6 +85,7 @@ public class Uniques implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/booleans/And.java b/main/src/com/google/refine/expr/functions/booleans/And.java index 47a13af82..794d5a524 100644 --- a/main/src/com/google/refine/expr/functions/booleans/And.java +++ b/main/src/com/google/refine/expr/functions/booleans/And.java @@ -42,6 +42,7 @@ import com.google.refine.grel.Function; public class And implements Function { + @Override public Object call(Properties bindings, Object[] args) { for (Object o : args) { if (!Not.objectToBoolean(o)) { @@ -51,6 +52,7 @@ public class And implements Function { return true; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/booleans/Not.java b/main/src/com/google/refine/expr/functions/booleans/Not.java index b8113702c..7d62806b0 100644 --- a/main/src/com/google/refine/expr/functions/booleans/Not.java +++ b/main/src/com/google/refine/expr/functions/booleans/Not.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Not implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { return !objectToBoolean(args[0]); @@ -56,6 +57,7 @@ public class Not implements Function { (o instanceof Boolean) ? ((Boolean) o).booleanValue() : Boolean.parseBoolean(o.toString())); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/booleans/Or.java b/main/src/com/google/refine/expr/functions/booleans/Or.java index 5b5201f53..935f1e8ef 100644 --- a/main/src/com/google/refine/expr/functions/booleans/Or.java +++ b/main/src/com/google/refine/expr/functions/booleans/Or.java @@ -42,6 +42,7 @@ import com.google.refine.grel.Function; public class Or implements Function { + @Override public Object call(Properties bindings, Object[] args) { for (Object o : args) { if (Not.objectToBoolean(o)) { @@ -51,6 +52,7 @@ public class Or implements Function { return false; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/date/DatePart.java b/main/src/com/google/refine/expr/functions/date/DatePart.java index 24ec9e41c..586fe73f7 100644 --- a/main/src/com/google/refine/expr/functions/date/DatePart.java +++ b/main/src/com/google/refine/expr/functions/date/DatePart.java @@ -46,6 +46,7 @@ import com.google.refine.grel.Function; public class DatePart implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2 && args[0] != null && (args[0] instanceof Calendar || args[0] instanceof Date) && @@ -91,6 +92,7 @@ public class DatePart implements Function { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); writer.key("description"); writer.value("Returns part of a date"); diff --git a/main/src/com/google/refine/expr/functions/date/Inc.java b/main/src/com/google/refine/expr/functions/date/Inc.java index cbf178560..0568f598b 100644 --- a/main/src/com/google/refine/expr/functions/date/Inc.java +++ b/main/src/com/google/refine/expr/functions/date/Inc.java @@ -46,6 +46,7 @@ import com.google.refine.grel.Function; public class Inc implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 3 && args[0] != null && (args[0] instanceof Calendar || args[0] instanceof Date) && @@ -89,6 +90,7 @@ public class Inc implements Function { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); writer.key("description"); writer.value("Returns a date changed by the given amount in the given unit of time"); diff --git a/main/src/com/google/refine/expr/functions/date/Now.java b/main/src/com/google/refine/expr/functions/date/Now.java index 1e7d06d01..dcb2a09bc 100644 --- a/main/src/com/google/refine/expr/functions/date/Now.java +++ b/main/src/com/google/refine/expr/functions/date/Now.java @@ -43,6 +43,7 @@ import com.google.refine.grel.Function; public class Now implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 0) { return Calendar.getInstance(); @@ -50,6 +51,7 @@ public class Now implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/html/HtmlAttr.java b/main/src/com/google/refine/expr/functions/html/HtmlAttr.java index 505fe367b..57ad9bd6c 100644 --- a/main/src/com/google/refine/expr/functions/html/HtmlAttr.java +++ b/main/src/com/google/refine/expr/functions/html/HtmlAttr.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class HtmlAttr implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 2) { Object o1 = args[0]; @@ -62,6 +63,7 @@ public class HtmlAttr implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/html/HtmlText.java b/main/src/com/google/refine/expr/functions/html/HtmlText.java index b3dc2bcdc..f03105a84 100644 --- a/main/src/com/google/refine/expr/functions/html/HtmlText.java +++ b/main/src/com/google/refine/expr/functions/html/HtmlText.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class HtmlText implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 1) { Object o1 = args[0]; @@ -60,6 +61,7 @@ public class HtmlText implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/html/InnerHtml.java b/main/src/com/google/refine/expr/functions/html/InnerHtml.java index db700340a..1b4a8ba8d 100644 --- a/main/src/com/google/refine/expr/functions/html/InnerHtml.java +++ b/main/src/com/google/refine/expr/functions/html/InnerHtml.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class InnerHtml implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 1) { Object o1 = args[0]; @@ -60,6 +61,7 @@ public class InnerHtml implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/html/ParseHtml.java b/main/src/com/google/refine/expr/functions/html/ParseHtml.java index 0c548d9f0..ea3f9ad0c 100644 --- a/main/src/com/google/refine/expr/functions/html/ParseHtml.java +++ b/main/src/com/google/refine/expr/functions/html/ParseHtml.java @@ -43,6 +43,7 @@ import com.google.refine.grel.Function; public class ParseHtml implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 1) { Object o1 = args[0]; @@ -54,6 +55,7 @@ public class ParseHtml implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/html/SelectHtml.java b/main/src/com/google/refine/expr/functions/html/SelectHtml.java index 8df670b73..f19a49b7a 100644 --- a/main/src/com/google/refine/expr/functions/html/SelectHtml.java +++ b/main/src/com/google/refine/expr/functions/html/SelectHtml.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class SelectHtml implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 2) { Object o1 = args[0]; @@ -62,6 +63,7 @@ public class SelectHtml implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/ACos.java b/main/src/com/google/refine/expr/functions/math/ACos.java index 067e0f7bc..a9b413343 100644 --- a/main/src/com/google/refine/expr/functions/math/ACos.java +++ b/main/src/com/google/refine/expr/functions/math/ACos.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class ACos implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.acos(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class ACos implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/ASin.java b/main/src/com/google/refine/expr/functions/math/ASin.java index b84dd8d8f..5cf085f79 100644 --- a/main/src/com/google/refine/expr/functions/math/ASin.java +++ b/main/src/com/google/refine/expr/functions/math/ASin.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class ASin implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.asin(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class ASin implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/ATan.java b/main/src/com/google/refine/expr/functions/math/ATan.java index b1bc88bea..b437f7edf 100644 --- a/main/src/com/google/refine/expr/functions/math/ATan.java +++ b/main/src/com/google/refine/expr/functions/math/ATan.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class ATan implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.atan(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class ATan implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/ATan2.java b/main/src/com/google/refine/expr/functions/math/ATan2.java index 2d98f1e13..9ce6344d3 100644 --- a/main/src/com/google/refine/expr/functions/math/ATan2.java +++ b/main/src/com/google/refine/expr/functions/math/ATan2.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class ATan2 implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2 && args[0] != null && args[0] instanceof Number && args[1] != null && args[1] instanceof Number) { @@ -52,6 +53,7 @@ public class ATan2 implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Abs.java b/main/src/com/google/refine/expr/functions/math/Abs.java index c661cf544..5864ab3a6 100644 --- a/main/src/com/google/refine/expr/functions/math/Abs.java +++ b/main/src/com/google/refine/expr/functions/math/Abs.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Abs implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.abs(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Abs implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Ceil.java b/main/src/com/google/refine/expr/functions/math/Ceil.java index ac40d9bd1..3053df1e9 100644 --- a/main/src/com/google/refine/expr/functions/math/Ceil.java +++ b/main/src/com/google/refine/expr/functions/math/Ceil.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Ceil implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return (long) Math.ceil(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Ceil implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Combin.java b/main/src/com/google/refine/expr/functions/math/Combin.java index aeb580c8e..88477dd4d 100644 --- a/main/src/com/google/refine/expr/functions/math/Combin.java +++ b/main/src/com/google/refine/expr/functions/math/Combin.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Combin implements Function { + @Override public Object call(Properties bindings, Object[] args) { if(args.length != 2) return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects two numbers"); @@ -66,6 +67,7 @@ public class Combin implements Function { return nFact / (rFact * nminusrFact); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Cos.java b/main/src/com/google/refine/expr/functions/math/Cos.java index dee5f34be..ef59820c3 100644 --- a/main/src/com/google/refine/expr/functions/math/Cos.java +++ b/main/src/com/google/refine/expr/functions/math/Cos.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Cos implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.cos(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Cos implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Cosh.java b/main/src/com/google/refine/expr/functions/math/Cosh.java index 08c052289..612c29571 100644 --- a/main/src/com/google/refine/expr/functions/math/Cosh.java +++ b/main/src/com/google/refine/expr/functions/math/Cosh.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Cosh implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return StrictMath.cosh(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Cosh implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Degrees.java b/main/src/com/google/refine/expr/functions/math/Degrees.java index 5f0dd6594..0533043c2 100644 --- a/main/src/com/google/refine/expr/functions/math/Degrees.java +++ b/main/src/com/google/refine/expr/functions/math/Degrees.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Degrees implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.toDegrees(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Degrees implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Even.java b/main/src/com/google/refine/expr/functions/math/Even.java index 0fe8ccc53..538e6dbca 100644 --- a/main/src/com/google/refine/expr/functions/math/Even.java +++ b/main/src/com/google/refine/expr/functions/math/Even.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Even implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Even.RoundUpToEven(((Number) args[0]).doubleValue()); @@ -56,6 +57,7 @@ public class Even implements Function { return ((temp % 2) == 0) ? temp : temp+1; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Exp.java b/main/src/com/google/refine/expr/functions/math/Exp.java index 1fc3ffaee..273bf732f 100644 --- a/main/src/com/google/refine/expr/functions/math/Exp.java +++ b/main/src/com/google/refine/expr/functions/math/Exp.java @@ -42,6 +42,7 @@ import com.google.refine.grel.Function; public class Exp implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] instanceof Number) { return Math.exp(((Number) args[0]).doubleValue()); @@ -49,6 +50,7 @@ public class Exp implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Fact.java b/main/src/com/google/refine/expr/functions/math/Fact.java index 3e20e2d44..145752848 100644 --- a/main/src/com/google/refine/expr/functions/math/Fact.java +++ b/main/src/com/google/refine/expr/functions/math/Fact.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Fact implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return FactN.factorial(((Number) args[0]).intValue(), 1); @@ -51,6 +52,7 @@ public class Fact implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/FactN.java b/main/src/com/google/refine/expr/functions/math/FactN.java index 177cbed27..496c33a5f 100644 --- a/main/src/com/google/refine/expr/functions/math/FactN.java +++ b/main/src/com/google/refine/expr/functions/math/FactN.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class FactN implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length != 2) return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects two numbers"); @@ -68,6 +69,7 @@ public class FactN implements Function { return i * FactN.factorial(i - step, step); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Floor.java b/main/src/com/google/refine/expr/functions/math/Floor.java index 850e8e13d..7b8d5552d 100644 --- a/main/src/com/google/refine/expr/functions/math/Floor.java +++ b/main/src/com/google/refine/expr/functions/math/Floor.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Floor implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return (long) Math.floor(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Floor implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/GreatestCommonDenominator.java b/main/src/com/google/refine/expr/functions/math/GreatestCommonDenominator.java index 9da0262ed..f23d5fc1b 100644 --- a/main/src/com/google/refine/expr/functions/math/GreatestCommonDenominator.java +++ b/main/src/com/google/refine/expr/functions/math/GreatestCommonDenominator.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class GreatestCommonDenominator implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2 && args[0] != null && args[0] instanceof Number && args[1] != null && args[1] instanceof Number) { @@ -56,6 +57,7 @@ public class GreatestCommonDenominator implements Function { return b == 0 ? a : GCD(b, a % b); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/LeastCommonMultiple.java b/main/src/com/google/refine/expr/functions/math/LeastCommonMultiple.java index 354ec1b88..2eedfd888 100644 --- a/main/src/com/google/refine/expr/functions/math/LeastCommonMultiple.java +++ b/main/src/com/google/refine/expr/functions/math/LeastCommonMultiple.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class LeastCommonMultiple implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2 && args[0] != null && args[0] instanceof Number @@ -67,6 +68,7 @@ public class LeastCommonMultiple implements Function { return largerValue * smallerValue; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Ln.java b/main/src/com/google/refine/expr/functions/math/Ln.java index 5d702f144..227eb15be 100644 --- a/main/src/com/google/refine/expr/functions/math/Ln.java +++ b/main/src/com/google/refine/expr/functions/math/Ln.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Ln implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.log(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Ln implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Log.java b/main/src/com/google/refine/expr/functions/math/Log.java index dadc0ae1a..e24b74955 100644 --- a/main/src/com/google/refine/expr/functions/math/Log.java +++ b/main/src/com/google/refine/expr/functions/math/Log.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Log implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.log10(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Log implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Max.java b/main/src/com/google/refine/expr/functions/math/Max.java index 708100fc8..a59d86cb8 100644 --- a/main/src/com/google/refine/expr/functions/math/Max.java +++ b/main/src/com/google/refine/expr/functions/math/Max.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Max implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2 && args[0] != null && args[0] instanceof Number && @@ -55,6 +56,7 @@ public class Max implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 numbers"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Min.java b/main/src/com/google/refine/expr/functions/math/Min.java index afbc8246b..7b7b146c2 100644 --- a/main/src/com/google/refine/expr/functions/math/Min.java +++ b/main/src/com/google/refine/expr/functions/math/Min.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Min implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2 && args[0] != null && args[0] instanceof Number && @@ -55,6 +56,7 @@ public class Min implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 numbers"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Mod.java b/main/src/com/google/refine/expr/functions/math/Mod.java index 968aa56e6..d48f93ced 100644 --- a/main/src/com/google/refine/expr/functions/math/Mod.java +++ b/main/src/com/google/refine/expr/functions/math/Mod.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Mod implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2 && args[0] != null && args[0] instanceof Number && @@ -56,6 +57,7 @@ public class Mod implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 numbers"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Multinomial.java b/main/src/com/google/refine/expr/functions/math/Multinomial.java index 93cb61885..1a7f31f5d 100644 --- a/main/src/com/google/refine/expr/functions/math/Multinomial.java +++ b/main/src/com/google/refine/expr/functions/math/Multinomial.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Multinomial implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length < 1) return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects one or more numbers"); @@ -59,6 +60,7 @@ public class Multinomial implements Function { return FactN.factorial(sum, 1) / product; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Odd.java b/main/src/com/google/refine/expr/functions/math/Odd.java index 48a7bbe1e..ded0a25ba 100644 --- a/main/src/com/google/refine/expr/functions/math/Odd.java +++ b/main/src/com/google/refine/expr/functions/math/Odd.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Odd implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Odd.RoundUpToOdd(((Number) args[0]).doubleValue()); @@ -56,6 +57,7 @@ public class Odd implements Function { return ((temp % 2) == 0) ? temp + 1 : temp; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Pow.java b/main/src/com/google/refine/expr/functions/math/Pow.java index d512a3f86..32e76c860 100644 --- a/main/src/com/google/refine/expr/functions/math/Pow.java +++ b/main/src/com/google/refine/expr/functions/math/Pow.java @@ -42,6 +42,7 @@ import com.google.refine.grel.Function; public class Pow implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2 && args[0] instanceof Number && args[1] instanceof Number) { return Math.pow( @@ -52,6 +53,7 @@ public class Pow implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Quotient.java b/main/src/com/google/refine/expr/functions/math/Quotient.java index 4fbc69d03..8cdd08d1e 100644 --- a/main/src/com/google/refine/expr/functions/math/Quotient.java +++ b/main/src/com/google/refine/expr/functions/math/Quotient.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Quotient implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2 && args[0] != null && args[0] instanceof Number && args[1] != null && args[1] instanceof Number) { @@ -52,6 +53,7 @@ public class Quotient implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects two numbers"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Radians.java b/main/src/com/google/refine/expr/functions/math/Radians.java index 9741887db..d509ab7f2 100644 --- a/main/src/com/google/refine/expr/functions/math/Radians.java +++ b/main/src/com/google/refine/expr/functions/math/Radians.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Radians implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.toRadians(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Radians implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Round.java b/main/src/com/google/refine/expr/functions/math/Round.java index f1f17420e..f88cdadbc 100644 --- a/main/src/com/google/refine/expr/functions/math/Round.java +++ b/main/src/com/google/refine/expr/functions/math/Round.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Round implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.round(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Round implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Sin.java b/main/src/com/google/refine/expr/functions/math/Sin.java index cadb13acf..7425befe4 100644 --- a/main/src/com/google/refine/expr/functions/math/Sin.java +++ b/main/src/com/google/refine/expr/functions/math/Sin.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Sin implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.sin(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Sin implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Sinh.java b/main/src/com/google/refine/expr/functions/math/Sinh.java index 43e19027a..59c28a1ab 100644 --- a/main/src/com/google/refine/expr/functions/math/Sinh.java +++ b/main/src/com/google/refine/expr/functions/math/Sinh.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Sinh implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return StrictMath.sinh(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Sinh implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Sum.java b/main/src/com/google/refine/expr/functions/math/Sum.java index d7d0759b8..aee0878e2 100644 --- a/main/src/com/google/refine/expr/functions/math/Sum.java +++ b/main/src/com/google/refine/expr/functions/math/Sum.java @@ -46,6 +46,7 @@ import com.google.refine.grel.Function; public class Sum implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { Object v = args[0]; @@ -80,6 +81,7 @@ public class Sum implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array of numbers"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Tan.java b/main/src/com/google/refine/expr/functions/math/Tan.java index 662beffe6..1e3a991f3 100644 --- a/main/src/com/google/refine/expr/functions/math/Tan.java +++ b/main/src/com/google/refine/expr/functions/math/Tan.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Tan implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return Math.tan(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Tan implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/math/Tanh.java b/main/src/com/google/refine/expr/functions/math/Tanh.java index 87f7a1bda..231290d9e 100644 --- a/main/src/com/google/refine/expr/functions/math/Tanh.java +++ b/main/src/com/google/refine/expr/functions/math/Tanh.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Tanh implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null && args[0] instanceof Number) { return StrictMath.tanh(((Number) args[0]).doubleValue()); @@ -51,6 +52,7 @@ public class Tanh implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Chomp.java b/main/src/com/google/refine/expr/functions/strings/Chomp.java index 1c12d902d..06573940d 100644 --- a/main/src/com/google/refine/expr/functions/strings/Chomp.java +++ b/main/src/com/google/refine/expr/functions/strings/Chomp.java @@ -43,6 +43,7 @@ import com.google.refine.grel.Function; public class Chomp implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object o1 = args[0]; @@ -54,6 +55,7 @@ public class Chomp implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Contains.java b/main/src/com/google/refine/expr/functions/strings/Contains.java index 8b711176a..dcfe23c57 100644 --- a/main/src/com/google/refine/expr/functions/strings/Contains.java +++ b/main/src/com/google/refine/expr/functions/strings/Contains.java @@ -42,6 +42,7 @@ import com.google.refine.grel.Function; public class Contains implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object s1 = args[0]; @@ -52,6 +53,7 @@ public class Contains implements Function { } return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Diff.java b/main/src/com/google/refine/expr/functions/strings/Diff.java index ca3ab6329..db1fcbeae 100644 --- a/main/src/com/google/refine/expr/functions/strings/Diff.java +++ b/main/src/com/google/refine/expr/functions/strings/Diff.java @@ -47,6 +47,7 @@ import com.google.refine.grel.Function; public class Diff implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 2 && args.length <= 3) { Object o1 = args[0]; @@ -82,6 +83,7 @@ public class Diff implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); writer.key("description"); writer.value("For strings, returns the portion where they differ. For dates, it returns the difference in given time units"); diff --git a/main/src/com/google/refine/expr/functions/strings/EndsWith.java b/main/src/com/google/refine/expr/functions/strings/EndsWith.java index 6e196c133..e9d97e391 100644 --- a/main/src/com/google/refine/expr/functions/strings/EndsWith.java +++ b/main/src/com/google/refine/expr/functions/strings/EndsWith.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class EndsWith implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object s1 = args[0]; @@ -55,6 +56,7 @@ public class EndsWith implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 strings"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Escape.java b/main/src/com/google/refine/expr/functions/strings/Escape.java index c82517d7a..0d5e074d5 100644 --- a/main/src/com/google/refine/expr/functions/strings/Escape.java +++ b/main/src/com/google/refine/expr/functions/strings/Escape.java @@ -47,6 +47,7 @@ import com.google.refine.grel.Function; public class Escape implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object o1 = args[0]; @@ -74,6 +75,7 @@ public class Escape implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Fingerprint.java b/main/src/com/google/refine/expr/functions/strings/Fingerprint.java index a8f08a038..2ec124915 100644 --- a/main/src/com/google/refine/expr/functions/strings/Fingerprint.java +++ b/main/src/com/google/refine/expr/functions/strings/Fingerprint.java @@ -46,6 +46,7 @@ public class Fingerprint implements Function { static Keyer fingerprint = new FingerprintKeyer(); + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null) { Object o = args[0]; @@ -55,6 +56,7 @@ public class Fingerprint implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/IndexOf.java b/main/src/com/google/refine/expr/functions/strings/IndexOf.java index ef050276b..a4e0a415c 100644 --- a/main/src/com/google/refine/expr/functions/strings/IndexOf.java +++ b/main/src/com/google/refine/expr/functions/strings/IndexOf.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class IndexOf implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object s1 = args[0]; @@ -55,6 +56,7 @@ public class IndexOf implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 strings"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/LastIndexOf.java b/main/src/com/google/refine/expr/functions/strings/LastIndexOf.java index e0567cc53..c80dac41b 100644 --- a/main/src/com/google/refine/expr/functions/strings/LastIndexOf.java +++ b/main/src/com/google/refine/expr/functions/strings/LastIndexOf.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class LastIndexOf implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object s1 = args[0]; @@ -55,6 +56,7 @@ public class LastIndexOf implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 strings"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/MD5.java b/main/src/com/google/refine/expr/functions/strings/MD5.java index 31e9ab7d8..84213e877 100644 --- a/main/src/com/google/refine/expr/functions/strings/MD5.java +++ b/main/src/com/google/refine/expr/functions/strings/MD5.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class MD5 implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null) { Object o = args[0]; @@ -54,6 +55,7 @@ public class MD5 implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Match.java b/main/src/com/google/refine/expr/functions/strings/Match.java index a70ab49af..d8f5e0816 100644 --- a/main/src/com/google/refine/expr/functions/strings/Match.java +++ b/main/src/com/google/refine/expr/functions/strings/Match.java @@ -46,6 +46,7 @@ import com.google.refine.grel.Function; public class Match implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object s = args[0]; @@ -76,6 +77,7 @@ public class Match implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string or a regexp"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/NGram.java b/main/src/com/google/refine/expr/functions/strings/NGram.java index 369c9ca6a..e2ff69fea 100644 --- a/main/src/com/google/refine/expr/functions/strings/NGram.java +++ b/main/src/com/google/refine/expr/functions/strings/NGram.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class NGram implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object s = args[0]; @@ -77,6 +78,7 @@ public class NGram implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string and a number"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/NGramFingerprint.java b/main/src/com/google/refine/expr/functions/strings/NGramFingerprint.java index 85a8bc1b9..d6d1c4da0 100644 --- a/main/src/com/google/refine/expr/functions/strings/NGramFingerprint.java +++ b/main/src/com/google/refine/expr/functions/strings/NGramFingerprint.java @@ -49,6 +49,7 @@ public class NGramFingerprint implements Function { static Keyer ngram_fingerprint = new NGramFingerprintKeyer(); + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 || args.length == 2) { if (args[0] != null) { @@ -74,6 +75,7 @@ public class NGramFingerprint implements Function { return set; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/ParseJson.java b/main/src/com/google/refine/expr/functions/strings/ParseJson.java index 31c806a08..20d1f46ab 100644 --- a/main/src/com/google/refine/expr/functions/strings/ParseJson.java +++ b/main/src/com/google/refine/expr/functions/strings/ParseJson.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class ParseJson implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 1) { Object o1 = args[0]; @@ -60,6 +61,7 @@ public class ParseJson implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Partition.java b/main/src/com/google/refine/expr/functions/strings/Partition.java index f699fcfdb..7163a5767 100644 --- a/main/src/com/google/refine/expr/functions/strings/Partition.java +++ b/main/src/com/google/refine/expr/functions/strings/Partition.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class Partition implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 2 && args.length <= 3) { Object o1 = args[0]; @@ -99,6 +100,7 @@ public class Partition implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/RPartition.java b/main/src/com/google/refine/expr/functions/strings/RPartition.java index 802e41134..3be977f92 100644 --- a/main/src/com/google/refine/expr/functions/strings/RPartition.java +++ b/main/src/com/google/refine/expr/functions/strings/RPartition.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class RPartition implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 2 && args.length <= 3) { Object o1 = args[0]; @@ -100,6 +101,7 @@ public class RPartition implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Reinterpret.java b/main/src/com/google/refine/expr/functions/strings/Reinterpret.java index f31ed91d7..d034049ee 100644 --- a/main/src/com/google/refine/expr/functions/strings/Reinterpret.java +++ b/main/src/com/google/refine/expr/functions/strings/Reinterpret.java @@ -48,6 +48,7 @@ import com.google.refine.model.Project; public class Reinterpret implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object o1 = args[0]; @@ -72,6 +73,7 @@ public class Reinterpret implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 arguments"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Replace.java b/main/src/com/google/refine/expr/functions/strings/Replace.java index 1a5291606..71b96fa71 100644 --- a/main/src/com/google/refine/expr/functions/strings/Replace.java +++ b/main/src/com/google/refine/expr/functions/strings/Replace.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class Replace implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 3) { Object o1 = args[0]; @@ -65,6 +66,7 @@ public class Replace implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/ReplaceChars.java b/main/src/com/google/refine/expr/functions/strings/ReplaceChars.java index 2790278a3..ca4f91bce 100644 --- a/main/src/com/google/refine/expr/functions/strings/ReplaceChars.java +++ b/main/src/com/google/refine/expr/functions/strings/ReplaceChars.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class ReplaceChars implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 3) { Object o1 = args[0]; @@ -59,6 +60,7 @@ public class ReplaceChars implements Function { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/SHA1.java b/main/src/com/google/refine/expr/functions/strings/SHA1.java index c20b797e3..204b5457e 100644 --- a/main/src/com/google/refine/expr/functions/strings/SHA1.java +++ b/main/src/com/google/refine/expr/functions/strings/SHA1.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class SHA1 implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null) { Object o = args[0]; @@ -54,6 +55,7 @@ public class SHA1 implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/SmartSplit.java b/main/src/com/google/refine/expr/functions/strings/SmartSplit.java index a3e814c9e..1c9f5152c 100644 --- a/main/src/com/google/refine/expr/functions/strings/SmartSplit.java +++ b/main/src/com/google/refine/expr/functions/strings/SmartSplit.java @@ -62,6 +62,7 @@ public class SmartSplit implements Function { CSVParser.DEFAULT_IGNORE_LEADING_WHITESPACE, false ); + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 1 && args.length <= 2) { CSVParser parser = null; @@ -99,6 +100,7 @@ public class SmartSplit implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 1 or 2 strings"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Split.java b/main/src/com/google/refine/expr/functions/strings/Split.java index 05db266be..a1f591321 100644 --- a/main/src/com/google/refine/expr/functions/strings/Split.java +++ b/main/src/com/google/refine/expr/functions/strings/Split.java @@ -46,6 +46,7 @@ import com.google.refine.grel.Function; public class Split implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 2 && args.length <= 3) { boolean preserveAllTokens = false; @@ -74,6 +75,7 @@ public class Split implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 strings, or 1 string and 1 regex, followed by an optional boolean"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/SplitByCharType.java b/main/src/com/google/refine/expr/functions/strings/SplitByCharType.java index 5c674486a..b7942f7ec 100644 --- a/main/src/com/google/refine/expr/functions/strings/SplitByCharType.java +++ b/main/src/com/google/refine/expr/functions/strings/SplitByCharType.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class SplitByCharType implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { Object o = args[0]; @@ -56,6 +57,7 @@ public class SplitByCharType implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 strings"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/SplitByLengths.java b/main/src/com/google/refine/expr/functions/strings/SplitByLengths.java index f0db6e848..dd827797e 100644 --- a/main/src/com/google/refine/expr/functions/strings/SplitByLengths.java +++ b/main/src/com/google/refine/expr/functions/strings/SplitByLengths.java @@ -43,6 +43,7 @@ import com.google.refine.grel.ControlFunctionRegistry; import com.google.refine.grel.Function; public class SplitByLengths implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length >= 2 && args[0] != null) { Object o = args[0]; @@ -69,6 +70,7 @@ public class SplitByLengths implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 1 string and 1 or more numbers"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/StartsWith.java b/main/src/com/google/refine/expr/functions/strings/StartsWith.java index f6d23880f..acf9d3d3d 100644 --- a/main/src/com/google/refine/expr/functions/strings/StartsWith.java +++ b/main/src/com/google/refine/expr/functions/strings/StartsWith.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class StartsWith implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object s1 = args[0]; @@ -54,6 +55,7 @@ public class StartsWith implements Function { } return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 strings"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/ToLowercase.java b/main/src/com/google/refine/expr/functions/strings/ToLowercase.java index a6c03e5e6..f9ec96990 100644 --- a/main/src/com/google/refine/expr/functions/strings/ToLowercase.java +++ b/main/src/com/google/refine/expr/functions/strings/ToLowercase.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class ToLowercase implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null) { Object o = args[0]; @@ -52,6 +53,7 @@ public class ToLowercase implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/ToTitlecase.java b/main/src/com/google/refine/expr/functions/strings/ToTitlecase.java index a17a69fc9..a69fe02aa 100644 --- a/main/src/com/google/refine/expr/functions/strings/ToTitlecase.java +++ b/main/src/com/google/refine/expr/functions/strings/ToTitlecase.java @@ -45,6 +45,7 @@ import com.google.refine.grel.Function; public class ToTitlecase implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null) { Object o = args[0]; @@ -55,6 +56,7 @@ public class ToTitlecase implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/ToUppercase.java b/main/src/com/google/refine/expr/functions/strings/ToUppercase.java index cce7caf79..f3b13db41 100644 --- a/main/src/com/google/refine/expr/functions/strings/ToUppercase.java +++ b/main/src/com/google/refine/expr/functions/strings/ToUppercase.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Function; public class ToUppercase implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null) { Object o = args[0]; @@ -52,6 +53,7 @@ public class ToUppercase implements Function { return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a string"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Trim.java b/main/src/com/google/refine/expr/functions/strings/Trim.java index df8b6373c..7d3f261dd 100644 --- a/main/src/com/google/refine/expr/functions/strings/Trim.java +++ b/main/src/com/google/refine/expr/functions/strings/Trim.java @@ -42,6 +42,7 @@ import com.google.refine.grel.Function; public class Trim implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1) { Object s1 = args[0]; @@ -51,6 +52,7 @@ public class Trim implements Function { } return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Unescape.java b/main/src/com/google/refine/expr/functions/strings/Unescape.java index 2d560fdf4..e08436a22 100644 --- a/main/src/com/google/refine/expr/functions/strings/Unescape.java +++ b/main/src/com/google/refine/expr/functions/strings/Unescape.java @@ -47,6 +47,7 @@ import com.google.refine.grel.Function; public class Unescape implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 2) { Object o1 = args[0]; @@ -74,6 +75,7 @@ public class Unescape implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/Unicode.java b/main/src/com/google/refine/expr/functions/strings/Unicode.java index 23d3f731b..d1bed5545 100644 --- a/main/src/com/google/refine/expr/functions/strings/Unicode.java +++ b/main/src/com/google/refine/expr/functions/strings/Unicode.java @@ -42,6 +42,7 @@ import com.google.refine.grel.Function; public class Unicode implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null) { Object o = args[0]; @@ -55,6 +56,7 @@ public class Unicode implements Function { return null; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/expr/functions/strings/UnicodeType.java b/main/src/com/google/refine/expr/functions/strings/UnicodeType.java index 18b670cac..3ca1e9aeb 100644 --- a/main/src/com/google/refine/expr/functions/strings/UnicodeType.java +++ b/main/src/com/google/refine/expr/functions/strings/UnicodeType.java @@ -42,6 +42,7 @@ import com.google.refine.grel.Function; public class UnicodeType implements Function { + @Override public Object call(Properties bindings, Object[] args) { if (args.length == 1 && args[0] != null) { Object o = args[0]; @@ -92,6 +93,7 @@ public class UnicodeType implements Function { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/grel/ast/ControlCallExpr.java b/main/src/com/google/refine/grel/ast/ControlCallExpr.java index d5aff75ca..f374f6d45 100644 --- a/main/src/com/google/refine/grel/ast/ControlCallExpr.java +++ b/main/src/com/google/refine/grel/ast/ControlCallExpr.java @@ -51,6 +51,7 @@ public class ControlCallExpr implements Evaluable { _control = c; } + @Override public Object evaluate(Properties bindings) { try { return _control.call(bindings, _args); diff --git a/main/src/com/google/refine/grel/ast/FieldAccessorExpr.java b/main/src/com/google/refine/grel/ast/FieldAccessorExpr.java index c8475b704..7564accf9 100644 --- a/main/src/com/google/refine/grel/ast/FieldAccessorExpr.java +++ b/main/src/com/google/refine/grel/ast/FieldAccessorExpr.java @@ -57,6 +57,7 @@ public class FieldAccessorExpr implements Evaluable { _fieldName = fieldName; } + @Override public Object evaluate(Properties bindings) { Object o = _inner.evaluate(bindings); if (ExpressionUtils.isError(o)) { diff --git a/main/src/com/google/refine/grel/ast/FunctionCallExpr.java b/main/src/com/google/refine/grel/ast/FunctionCallExpr.java index 06c216c06..008211097 100644 --- a/main/src/com/google/refine/grel/ast/FunctionCallExpr.java +++ b/main/src/com/google/refine/grel/ast/FunctionCallExpr.java @@ -55,6 +55,7 @@ public class FunctionCallExpr implements Evaluable { _function = f; } + @Override public Object evaluate(Properties bindings) { Object[] args = new Object[_args.length]; for (int i = 0; i < _args.length; i++) { @@ -71,6 +72,7 @@ public class FunctionCallExpr implements Evaluable { } } + @Override public String toString() { StringBuffer sb = new StringBuffer(); diff --git a/main/src/com/google/refine/grel/ast/LiteralExpr.java b/main/src/com/google/refine/grel/ast/LiteralExpr.java index a8317391d..8c04ade8f 100644 --- a/main/src/com/google/refine/grel/ast/LiteralExpr.java +++ b/main/src/com/google/refine/grel/ast/LiteralExpr.java @@ -49,10 +49,12 @@ public class LiteralExpr implements Evaluable { _value = value; } + @Override public Object evaluate(Properties bindings) { return _value; } + @Override public String toString() { return _value instanceof String ? JSONObject.quote((String) _value) : _value.toString(); } diff --git a/main/src/com/google/refine/grel/ast/VariableExpr.java b/main/src/com/google/refine/grel/ast/VariableExpr.java index 78a4ac630..17fcdf464 100644 --- a/main/src/com/google/refine/grel/ast/VariableExpr.java +++ b/main/src/com/google/refine/grel/ast/VariableExpr.java @@ -47,10 +47,12 @@ public class VariableExpr implements Evaluable { _name = name; } + @Override public Object evaluate(Properties bindings) { return bindings.get(_name); } + @Override public String toString() { return _name; } diff --git a/main/src/com/google/refine/grel/controls/Filter.java b/main/src/com/google/refine/grel/controls/Filter.java index 954458d11..4b993aa6b 100644 --- a/main/src/com/google/refine/grel/controls/Filter.java +++ b/main/src/com/google/refine/grel/controls/Filter.java @@ -50,6 +50,7 @@ import com.google.refine.grel.ControlFunctionRegistry; import com.google.refine.grel.ast.VariableExpr; public class Filter implements Control { + @Override public String checkArguments(Evaluable[] args) { if (args.length != 3) { return ControlFunctionRegistry.getControlName(this) + " expects 3 arguments"; @@ -60,6 +61,7 @@ public class Filter implements Control { return null; } + @Override public Object call(Properties bindings, Evaluable[] args) { Object o = args[0].evaluate(bindings); if (ExpressionUtils.isError(o)) { @@ -133,6 +135,7 @@ public class Filter implements Control { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/grel/controls/ForEach.java b/main/src/com/google/refine/grel/controls/ForEach.java index b535d8489..977f4633b 100644 --- a/main/src/com/google/refine/grel/controls/ForEach.java +++ b/main/src/com/google/refine/grel/controls/ForEach.java @@ -50,6 +50,7 @@ import com.google.refine.grel.ControlFunctionRegistry; import com.google.refine.grel.ast.VariableExpr; public class ForEach implements Control { + @Override public String checkArguments(Evaluable[] args) { if (args.length != 3) { return ControlFunctionRegistry.getControlName(this) + " expects 3 arguments"; @@ -60,6 +61,7 @@ public class ForEach implements Control { return null; } + @Override public Object call(Properties bindings, Evaluable[] args) { Object o = args[0].evaluate(bindings); if (ExpressionUtils.isError(o)) { @@ -130,6 +132,7 @@ public class ForEach implements Control { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/grel/controls/ForEachIndex.java b/main/src/com/google/refine/grel/controls/ForEachIndex.java index 51ec1d231..e7620c2b5 100644 --- a/main/src/com/google/refine/grel/controls/ForEachIndex.java +++ b/main/src/com/google/refine/grel/controls/ForEachIndex.java @@ -49,6 +49,7 @@ import com.google.refine.grel.ControlFunctionRegistry; import com.google.refine.grel.ast.VariableExpr; public class ForEachIndex implements Control { + @Override public String checkArguments(Evaluable[] args) { if (args.length != 4) { return ControlFunctionRegistry.getControlName(this) + " expects 4 arguments"; @@ -62,6 +63,7 @@ public class ForEachIndex implements Control { return null; } + @Override public Object call(Properties bindings, Evaluable[] args) { Object o = args[0].evaluate(bindings); if (ExpressionUtils.isError(o)) { @@ -147,6 +149,7 @@ public class ForEachIndex implements Control { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/grel/controls/ForNonBlank.java b/main/src/com/google/refine/grel/controls/ForNonBlank.java index ced68c504..664c27636 100644 --- a/main/src/com/google/refine/grel/controls/ForNonBlank.java +++ b/main/src/com/google/refine/grel/controls/ForNonBlank.java @@ -45,6 +45,7 @@ import com.google.refine.grel.ControlFunctionRegistry; import com.google.refine.grel.ast.VariableExpr; public class ForNonBlank implements Control { + @Override public String checkArguments(Evaluable[] args) { if (args.length != 4) { return ControlFunctionRegistry.getControlName(this) + " expects 4 arguments"; @@ -55,6 +56,7 @@ public class ForNonBlank implements Control { return null; } + @Override public Object call(Properties bindings, Evaluable[] args) { Object o = args[0].evaluate(bindings); @@ -82,6 +84,7 @@ public class ForNonBlank implements Control { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/grel/controls/ForRange.java b/main/src/com/google/refine/grel/controls/ForRange.java index cd2f2b9af..5a37a28af 100644 --- a/main/src/com/google/refine/grel/controls/ForRange.java +++ b/main/src/com/google/refine/grel/controls/ForRange.java @@ -48,6 +48,7 @@ import com.google.refine.grel.ControlFunctionRegistry; import com.google.refine.grel.ast.VariableExpr; public class ForRange implements Control { + @Override public String checkArguments(Evaluable[] args) { if (args.length != 5) { return ControlFunctionRegistry.getControlName(this) + " expects 5 arguments"; @@ -58,6 +59,7 @@ public class ForRange implements Control { return null; } + @Override public Object call(Properties bindings, Evaluable[] args) { Object fromO = args[0].evaluate(bindings); Object toO = args[1].evaluate(bindings); @@ -129,6 +131,7 @@ public class ForRange implements Control { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/grel/controls/If.java b/main/src/com/google/refine/grel/controls/If.java index 8a1ca2ed0..2139c5160 100644 --- a/main/src/com/google/refine/grel/controls/If.java +++ b/main/src/com/google/refine/grel/controls/If.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Control; import com.google.refine.grel.ControlFunctionRegistry; public class If implements Control { + @Override public String checkArguments(Evaluable[] args) { if (args.length != 3) { return ControlFunctionRegistry.getControlName(this) + " expects 3 arguments"; @@ -51,6 +52,7 @@ public class If implements Control { return null; } + @Override public Object call(Properties bindings, Evaluable[] args) { Object o = args[0].evaluate(bindings); if (ExpressionUtils.isError(o)) { @@ -62,6 +64,7 @@ public class If implements Control { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/grel/controls/IsTest.java b/main/src/com/google/refine/grel/controls/IsTest.java index e02bc94a9..32c2f2524 100644 --- a/main/src/com/google/refine/grel/controls/IsTest.java +++ b/main/src/com/google/refine/grel/controls/IsTest.java @@ -44,6 +44,7 @@ import com.google.refine.grel.Control; import com.google.refine.grel.ControlFunctionRegistry; abstract class IsTest implements Control { + @Override public String checkArguments(Evaluable[] args) { if (args.length != 1) { return ControlFunctionRegistry.getControlName(this) + " expects one argument"; @@ -51,6 +52,7 @@ abstract class IsTest implements Control { return null; } + @Override public Object call(Properties bindings, Evaluable[] args) { Object o; try { @@ -61,6 +63,7 @@ abstract class IsTest implements Control { return test(o); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/grel/controls/With.java b/main/src/com/google/refine/grel/controls/With.java index 97518d8eb..0833df080 100644 --- a/main/src/com/google/refine/grel/controls/With.java +++ b/main/src/com/google/refine/grel/controls/With.java @@ -44,6 +44,7 @@ import com.google.refine.grel.ControlFunctionRegistry; import com.google.refine.grel.ast.VariableExpr; public class With implements Control { + @Override public String checkArguments(Evaluable[] args) { if (args.length != 3) { return ControlFunctionRegistry.getControlName(this) + " expects 3 arguments"; @@ -54,6 +55,7 @@ public class With implements Control { return null; } + @Override public Object call(Properties bindings, Evaluable[] args) { Object o = args[0].evaluate(bindings); String name = ((VariableExpr) args[1]).getName(); @@ -79,6 +81,7 @@ public class With implements Control { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/history/ChangeSequence.java b/main/src/com/google/refine/history/ChangeSequence.java index fe822672e..644d5eda6 100644 --- a/main/src/com/google/refine/history/ChangeSequence.java +++ b/main/src/com/google/refine/history/ChangeSequence.java @@ -48,6 +48,7 @@ public class ChangeSequence implements Change { _changes = changes; } + @Override public void apply(Project project) { synchronized (project) { for (int i = 0; i < _changes.length; i++) { @@ -56,6 +57,7 @@ public class ChangeSequence implements Change { } } + @Override public void revert(Project project) { synchronized (project) { for (int i = _changes.length - 1; i >= 0 ; i--) { @@ -64,6 +66,7 @@ public class ChangeSequence implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("count="); writer.write(Integer.toString(_changes.length)); writer.write('\n'); for (int i = 0; i < _changes.length; i++) { diff --git a/main/src/com/google/refine/history/History.java b/main/src/com/google/refine/history/History.java index c65bd37d8..d56b6da29 100644 --- a/main/src/com/google/refine/history/History.java +++ b/main/src/com/google/refine/history/History.java @@ -252,6 +252,7 @@ public class History implements Jsonizable { } } + @Override synchronized public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/history/HistoryEntry.java b/main/src/com/google/refine/history/HistoryEntry.java index d56111587..f14bc967a 100644 --- a/main/src/com/google/refine/history/HistoryEntry.java +++ b/main/src/com/google/refine/history/HistoryEntry.java @@ -101,6 +101,7 @@ public class HistoryEntry implements Jsonizable { this._manager = ProjectManager.singleton.getHistoryEntryManager(); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/history/HistoryProcess.java b/main/src/com/google/refine/history/HistoryProcess.java index 4d218a604..0004e2c86 100644 --- a/main/src/com/google/refine/history/HistoryProcess.java +++ b/main/src/com/google/refine/history/HistoryProcess.java @@ -67,14 +67,17 @@ public class HistoryProcess extends Process { } } + @Override public void cancel() { throw new RuntimeException(WARN); } + @Override public boolean isImmediate() { return true; } + @Override public HistoryEntry performImmediate() { _project.history.undoRedo(_lastDoneID); _done = true; @@ -82,10 +85,12 @@ public class HistoryProcess extends Process { return null; } + @Override public void startPerforming(ProcessManager manager) { throw new RuntimeException(WARN); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -96,10 +101,12 @@ public class HistoryProcess extends Process { writer.endObject(); } + @Override public boolean isDone() { throw new RuntimeException(WARN); } + @Override public boolean isRunning() { throw new RuntimeException(WARN); } diff --git a/main/src/com/google/refine/importers/tree/ImportColumnGroup.java b/main/src/com/google/refine/importers/tree/ImportColumnGroup.java index f25c5ba05..c85194e39 100644 --- a/main/src/com/google/refine/importers/tree/ImportColumnGroup.java +++ b/main/src/com/google/refine/importers/tree/ImportColumnGroup.java @@ -25,6 +25,7 @@ public class ImportColumnGroup extends ImportVertical { } } + @Override public String toString() { return String.format("name=%s, columns={%s}, subgroups={{%s}}", name,StringUtils.join(columns.keySet(), ','), diff --git a/main/src/com/google/refine/importers/tree/RecordElementCandidate.java b/main/src/com/google/refine/importers/tree/RecordElementCandidate.java index 3be1b62c9..a7908c456 100644 --- a/main/src/com/google/refine/importers/tree/RecordElementCandidate.java +++ b/main/src/com/google/refine/importers/tree/RecordElementCandidate.java @@ -10,6 +10,7 @@ class RecordElementCandidate { String[] path; int count; + @Override public String toString() { return Arrays.toString(path); } diff --git a/main/src/com/google/refine/importers/tree/TreeImportUtilities.java b/main/src/com/google/refine/importers/tree/TreeImportUtilities.java index 38496519b..597beae8a 100644 --- a/main/src/com/google/refine/importers/tree/TreeImportUtilities.java +++ b/main/src/com/google/refine/importers/tree/TreeImportUtilities.java @@ -52,6 +52,7 @@ public abstract class TreeImportUtilities { static protected void sortRecordElementCandidates(List list) { Collections.sort(list, new Comparator() { + @Override public int compare(RecordElementCandidate o1, RecordElementCandidate o2) { return o2.count - o1.count; } @@ -66,6 +67,7 @@ public abstract class TreeImportUtilities { List columns = new ArrayList(columnGroup.columns.values()); Collections.sort(columns, new Comparator() { + @Override public int compare(ImportColumn o1, ImportColumn o2) { if (o1.blankOnFirstRow != o2.blankOnFirstRow) { return o1.blankOnFirstRow ? 1 : -1; @@ -85,6 +87,7 @@ public abstract class TreeImportUtilities { List subgroups = new ArrayList(columnGroup.subgroups.values()); Collections.sort(subgroups, new Comparator() { + @Override public int compare(ImportColumnGroup o1, ImportColumnGroup o2) { int c = o2.nonBlankCount - o1.nonBlankCount; return c != 0 ? c : (o1.name.length() - o2.name.length()); diff --git a/main/src/com/google/refine/importing/ImportingUtilities.java b/main/src/com/google/refine/importing/ImportingUtilities.java index e657f3416..f51b20647 100644 --- a/main/src/com/google/refine/importing/ImportingUtilities.java +++ b/main/src/com/google/refine/importing/ImportingUtilities.java @@ -117,6 +117,7 @@ public class ImportingUtilities { } JSONUtilities.safePut(progress, "percent", percent); } + @Override public boolean isCanceled() { return job.canceled; } @@ -853,6 +854,7 @@ public class ImportingUtilities { final Project project = new Project(); new Thread() { + @Override public void run() { ProjectMetadata pm = new ProjectMetadata(); pm.setName(JSONUtilities.getString(optionObj, "projectName", "Untitled")); diff --git a/main/src/com/google/refine/io/FileHistoryEntryManager.java b/main/src/com/google/refine/io/FileHistoryEntryManager.java index aa22ce2bc..e9cb85047 100644 --- a/main/src/com/google/refine/io/FileHistoryEntryManager.java +++ b/main/src/com/google/refine/io/FileHistoryEntryManager.java @@ -54,6 +54,7 @@ import com.google.refine.util.Pool; public class FileHistoryEntryManager implements HistoryEntryManager{ + @Override public void delete(HistoryEntry historyEntry) { File file = getChangeFile(historyEntry); if (file.exists()) { @@ -61,6 +62,7 @@ public class FileHistoryEntryManager implements HistoryEntryManager{ } } + @Override public void save(HistoryEntry historyEntry, Writer writer, Properties options) { JSONWriter jsonWriter = new JSONWriter(writer); try { @@ -70,6 +72,7 @@ public class FileHistoryEntryManager implements HistoryEntryManager{ } } + @Override public void loadChange(HistoryEntry historyEntry) { File changeFile = getChangeFile(historyEntry); @@ -97,6 +100,7 @@ public class FileHistoryEntryManager implements HistoryEntryManager{ } } + @Override public void saveChange(HistoryEntry historyEntry) throws Exception { File changeFile = getChangeFile(historyEntry); if (!(changeFile.exists())) { diff --git a/main/src/com/google/refine/io/FileProjectManager.java b/main/src/com/google/refine/io/FileProjectManager.java index 073665335..97d7fc826 100644 --- a/main/src/com/google/refine/io/FileProjectManager.java +++ b/main/src/com/google/refine/io/FileProjectManager.java @@ -110,6 +110,7 @@ public class FileProjectManager extends ProjectManager { * * @param projectID */ + @Override public boolean loadProjectMetadata(long projectID) { synchronized (this) { ProjectMetadata metadata = ProjectMetadataUtilities.load(getProjectDir(projectID)); @@ -122,6 +123,7 @@ public class FileProjectManager extends ProjectManager { } } + @Override public void importProject(long projectID, InputStream inputStream, boolean gziped) throws IOException { File destDir = this.getProjectDir(projectID); destDir.mkdirs(); @@ -159,6 +161,7 @@ public class FileProjectManager extends ProjectManager { } } + @Override public void exportProject(long projectId, TarOutputStream tos) throws IOException { File dir = this.getProjectDir(projectId); this.tarDir("", dir, tos); @@ -216,6 +219,7 @@ public class FileProjectManager extends ProjectManager { ProjectUtilities.save(project); } + @Override public Project loadProject(long id) { return ProjectUtilities.load(getProjectDir(id), id); } @@ -288,6 +292,7 @@ public class FileProjectManager extends ProjectManager { + @Override public void deleteProject(long projectID) { synchronized (this) { removeProject(projectID); @@ -400,6 +405,7 @@ public class FileProjectManager extends ProjectManager { } } + @Override public HistoryEntryManager getHistoryEntryManager(){ return new FileHistoryEntryManager(); } diff --git a/main/src/com/google/refine/logging/IndentingLayout.java b/main/src/com/google/refine/logging/IndentingLayout.java index 6d0b5be65..0d5f4485e 100644 --- a/main/src/com/google/refine/logging/IndentingLayout.java +++ b/main/src/com/google/refine/logging/IndentingLayout.java @@ -85,10 +85,12 @@ public class IndentingLayout extends Layout { protected long previousTime = 0; protected int indentation = 0; + @Override public void activateOptions() { // no options at this time } + @Override public String format(LoggingEvent event) { String message = event.getRenderedMessage(); if (message == null) return ""; @@ -170,6 +172,7 @@ public class IndentingLayout extends Layout { } } + @Override public boolean ignoresThrowable() { return true; } diff --git a/main/src/com/google/refine/model/Cell.java b/main/src/com/google/refine/model/Cell.java index 3ff0bd38d..4a349a4a3 100644 --- a/main/src/com/google/refine/model/Cell.java +++ b/main/src/com/google/refine/model/Cell.java @@ -61,6 +61,7 @@ public class Cell implements HasFields, Jsonizable { this.recon = recon; } + @Override public Object getField(String name, Properties bindings) { if ("value".equals(name)) { return value; @@ -70,10 +71,12 @@ public class Cell implements HasFields, Jsonizable { return null; } + @Override public boolean fieldAlsoHasFields(String name) { return "recon".equals(name); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); if (ExpressionUtils.isError(value)) { @@ -180,6 +183,7 @@ public class Cell implements HasFields, Jsonizable { } } + @Override public String toString() { return value.toString(); } diff --git a/main/src/com/google/refine/model/ColumnGroup.java b/main/src/com/google/refine/model/ColumnGroup.java index 434e9ab5f..9df67f2dc 100644 --- a/main/src/com/google/refine/model/ColumnGroup.java +++ b/main/src/com/google/refine/model/ColumnGroup.java @@ -60,6 +60,7 @@ public class ColumnGroup implements Jsonizable { internalInitialize(); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -107,6 +108,7 @@ public class ColumnGroup implements Jsonizable { subgroups = new LinkedList(); } + @Override public String toString() { return String.format("%d:%d:k=%d",startColumnIndex,columnSpan,keyColumnIndex); } diff --git a/main/src/com/google/refine/model/Recon.java b/main/src/com/google/refine/model/Recon.java index 7e9588305..96b2bdc0b 100644 --- a/main/src/com/google/refine/model/Recon.java +++ b/main/src/com/google/refine/model/Recon.java @@ -201,6 +201,7 @@ public class Recon implements HasFields, Jsonizable { features[feature] = v; } + @Override public Object getField(String name, Properties bindings) { if ("id".equals(name)) { return id; @@ -236,6 +237,7 @@ public class Recon implements HasFields, Jsonizable { return null; } + @Override public boolean fieldAlsoHasFields(String name) { return "match".equals(name) || "best".equals(name); } @@ -245,16 +247,19 @@ public class Recon implements HasFields, Jsonizable { } public class Features implements HasFields { + @Override public Object getField(String name, Properties bindings) { int index = s_featureMap.get(name); return index < features.length ? features[index] : null; } + @Override public boolean fieldAlsoHasFields(String name) { return false; } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/model/ReconCandidate.java b/main/src/com/google/refine/model/ReconCandidate.java index 0dab49c9e..4c9a4de8d 100644 --- a/main/src/com/google/refine/model/ReconCandidate.java +++ b/main/src/com/google/refine/model/ReconCandidate.java @@ -59,6 +59,7 @@ public class ReconCandidate implements HasFields, Jsonizable { this.score = score; } + @Override public Object getField(String name, Properties bindings) { if ("id".equals(name)) { return id; @@ -72,10 +73,12 @@ public class ReconCandidate implements HasFields, Jsonizable { return null; } + @Override public boolean fieldAlsoHasFields(String name) { return false; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/model/ReconStats.java b/main/src/com/google/refine/model/ReconStats.java index e77dd881d..a0c3ea6d4 100644 --- a/main/src/com/google/refine/model/ReconStats.java +++ b/main/src/com/google/refine/model/ReconStats.java @@ -63,6 +63,7 @@ public class ReconStats implements Jsonizable { this.matchedTopics = matchedTopics; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/model/RecordModel.java b/main/src/com/google/refine/model/RecordModel.java index 79fa1a367..1eca769cb 100644 --- a/main/src/com/google/refine/model/RecordModel.java +++ b/main/src/com/google/refine/model/RecordModel.java @@ -90,6 +90,7 @@ public class RecordModel implements Jsonizable { return null; } + @Override synchronized public void write(JSONWriter writer, Properties options) throws JSONException { @@ -208,6 +209,7 @@ public class RecordModel implements Jsonizable { } Collections.sort(keyedGroups, new Comparator() { + @Override public int compare(KeyedGroup o1, KeyedGroup o2) { return o2.cellIndices.length - o1.cellIndices.length; // larger groups first } diff --git a/main/src/com/google/refine/model/Row.java b/main/src/com/google/refine/model/Row.java index f0583f18c..4b5db9d7c 100644 --- a/main/src/com/google/refine/model/Row.java +++ b/main/src/com/google/refine/model/Row.java @@ -76,6 +76,7 @@ public class Row implements HasFields, Jsonizable { return row; } + @Override public Object getField(String name, Properties bindings) { if (FLAGGED.equals(name)) { return flagged; @@ -85,6 +86,7 @@ public class Row implements HasFields, Jsonizable { return null; } + @Override public boolean fieldAlsoHasFields(String name) { return "cells".equals(name) || "record".equals(name); } @@ -139,6 +141,7 @@ public class Row implements HasFields, Jsonizable { return new CellTuple(project, this); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -232,6 +235,7 @@ public class Row implements HasFields, Jsonizable { return (cells.size() > 0) ? new Row(cells, flagged, starred) : null; } + @Override public String toString() { StringBuffer result = new StringBuffer(); for (Cell cell : cells) { diff --git a/main/src/com/google/refine/model/changes/CellChange.java b/main/src/com/google/refine/model/changes/CellChange.java index 77f61bd78..eff993cbb 100644 --- a/main/src/com/google/refine/model/changes/CellChange.java +++ b/main/src/com/google/refine/model/changes/CellChange.java @@ -56,18 +56,21 @@ public class CellChange implements Change { this.newCell = newCell; } + @Override public void apply(Project project) { project.rows.get(row).setCell(cellIndex, newCell); project.columnModel.getColumnByCellIndex(cellIndex).clearPrecomputes(); } + @Override public void revert(Project project) { project.rows.get(row).setCell(cellIndex, oldCell); project.columnModel.getColumnByCellIndex(cellIndex).clearPrecomputes(); } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("row="); writer.write(Integer.toString(row)); writer.write('\n'); writer.write("cell="); writer.write(Integer.toString(cellIndex)); writer.write('\n'); diff --git a/main/src/com/google/refine/model/changes/ColumnAdditionChange.java b/main/src/com/google/refine/model/changes/ColumnAdditionChange.java index e0db19c67..f3a6afcee 100644 --- a/main/src/com/google/refine/model/changes/ColumnAdditionChange.java +++ b/main/src/com/google/refine/model/changes/ColumnAdditionChange.java @@ -62,6 +62,7 @@ public class ColumnAdditionChange extends ColumnChange { newCells.toArray(_newCells); } + @Override public void apply(Project project) { synchronized (project) { if (_newCellIndex < 0) { @@ -110,6 +111,7 @@ public class ColumnAdditionChange extends ColumnChange { } } + @Override public void revert(Project project) { synchronized (project) { for (CellAtRow cell : _newCells) { @@ -126,6 +128,7 @@ public class ColumnAdditionChange extends ColumnChange { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("columnName="); writer.write(_columnName); writer.write('\n'); writer.write("columnIndex="); writer.write(Integer.toString(_columnIndex)); writer.write('\n'); diff --git a/main/src/com/google/refine/model/changes/ColumnMoveChange.java b/main/src/com/google/refine/model/changes/ColumnMoveChange.java index e5f1055e4..f5fac282f 100644 --- a/main/src/com/google/refine/model/changes/ColumnMoveChange.java +++ b/main/src/com/google/refine/model/changes/ColumnMoveChange.java @@ -58,6 +58,7 @@ public class ColumnMoveChange extends ColumnChange { _newColumnIndex = index; } + @Override public void apply(Project project) { synchronized (project) { _oldColumnIndex = project.columnModel.getColumnIndexByName(_columnName); @@ -74,6 +75,7 @@ public class ColumnMoveChange extends ColumnChange { } } + @Override public void revert(Project project) { synchronized (project) { Column column = project.columnModel.columns.remove(_newColumnIndex); @@ -86,6 +88,7 @@ public class ColumnMoveChange extends ColumnChange { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("columnName="); writer.write(_columnName); writer.write('\n'); writer.write("oldColumnIndex="); writer.write(Integer.toString(_oldColumnIndex)); writer.write('\n'); diff --git a/main/src/com/google/refine/model/changes/ColumnRemovalChange.java b/main/src/com/google/refine/model/changes/ColumnRemovalChange.java index e7c57ee1c..70a2b0636 100644 --- a/main/src/com/google/refine/model/changes/ColumnRemovalChange.java +++ b/main/src/com/google/refine/model/changes/ColumnRemovalChange.java @@ -59,6 +59,7 @@ public class ColumnRemovalChange extends ColumnChange { _oldColumnIndex = index; } + @Override public void apply(Project project) { synchronized (project) { int columnGroupCount = project.columnModel.columnGroups.size(); @@ -116,6 +117,7 @@ public class ColumnRemovalChange extends ColumnChange { } } + @Override public void revert(Project project) { synchronized (project) { project.columnModel.columns.add(_oldColumnIndex, _oldColumn); @@ -132,6 +134,7 @@ public class ColumnRemovalChange extends ColumnChange { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("oldColumnIndex="); writer.write(Integer.toString(_oldColumnIndex)); writer.write('\n'); writer.write("oldColumn="); _oldColumn.save(writer); writer.write('\n'); diff --git a/main/src/com/google/refine/model/changes/ColumnRenameChange.java b/main/src/com/google/refine/model/changes/ColumnRenameChange.java index deba6c74c..1e0f0a5af 100644 --- a/main/src/com/google/refine/model/changes/ColumnRenameChange.java +++ b/main/src/com/google/refine/model/changes/ColumnRenameChange.java @@ -51,6 +51,7 @@ public class ColumnRenameChange extends ColumnChange { _newColumnName = newColumnName; } + @Override public void apply(Project project) { synchronized (project) { project.columnModel.getColumnByName(_oldColumnName).setName(_newColumnName); @@ -58,6 +59,7 @@ public class ColumnRenameChange extends ColumnChange { } } + @Override public void revert(Project project) { synchronized (project) { project.columnModel.getColumnByName(_newColumnName).setName(_oldColumnName); @@ -65,6 +67,7 @@ public class ColumnRenameChange extends ColumnChange { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("oldColumnName="); writer.write(_oldColumnName); writer.write('\n'); writer.write("newColumnName="); writer.write(_newColumnName); writer.write('\n'); diff --git a/main/src/com/google/refine/model/changes/ColumnReorderChange.java b/main/src/com/google/refine/model/changes/ColumnReorderChange.java index 9c9fe21bf..bdf714998 100644 --- a/main/src/com/google/refine/model/changes/ColumnReorderChange.java +++ b/main/src/com/google/refine/model/changes/ColumnReorderChange.java @@ -57,6 +57,7 @@ public class ColumnReorderChange extends ColumnChange { _columnNames = columnNames; } + @Override public void apply(Project project) { synchronized (project) { if (_newColumns == null) { @@ -81,6 +82,7 @@ public class ColumnReorderChange extends ColumnChange { } } + @Override public void revert(Project project) { synchronized (project) { project.columnModel.columns.clear(); @@ -93,6 +95,7 @@ public class ColumnReorderChange extends ColumnChange { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("columnNameCount="); writer.write(Integer.toString(_columnNames.size())); writer.write('\n'); for (String n : _columnNames) { diff --git a/main/src/com/google/refine/model/changes/ColumnSplitChange.java b/main/src/com/google/refine/model/changes/ColumnSplitChange.java index b8af956c8..5d16be5f1 100644 --- a/main/src/com/google/refine/model/changes/ColumnSplitChange.java +++ b/main/src/com/google/refine/model/changes/ColumnSplitChange.java @@ -117,6 +117,7 @@ public class ColumnSplitChange implements Change { _newRows = newRows; } + @Override public void apply(Project project) { synchronized (project) { if (_firstNewCellIndex < 0) { @@ -223,6 +224,7 @@ public class ColumnSplitChange implements Change { } } + @Override public void revert(Project project) { synchronized (project) { for (int i = 0; i < _rowIndices.size(); i++) { @@ -247,6 +249,7 @@ public class ColumnSplitChange implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("columnName="); writer.write(_columnName); writer.write('\n'); diff --git a/main/src/com/google/refine/model/changes/MassCellChange.java b/main/src/com/google/refine/model/changes/MassCellChange.java index 5d0706b54..7c23d1c0e 100644 --- a/main/src/com/google/refine/model/changes/MassCellChange.java +++ b/main/src/com/google/refine/model/changes/MassCellChange.java @@ -81,6 +81,7 @@ public class MassCellChange implements Change { _updateRowContextDependencies = updateRowContextDependencies; } + @Override public void apply(Project project) { synchronized (project) { List rows = project.rows; @@ -100,6 +101,7 @@ public class MassCellChange implements Change { } } + @Override public void revert(Project project) { synchronized (project) { List rows = project.rows; @@ -119,6 +121,7 @@ public class MassCellChange implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { if (_commonColumnName != null) { writer.write("commonColumnName="); writer.write(_commonColumnName); writer.write('\n'); diff --git a/main/src/com/google/refine/model/changes/MassChange.java b/main/src/com/google/refine/model/changes/MassChange.java index 0a640c14f..c717f2057 100644 --- a/main/src/com/google/refine/model/changes/MassChange.java +++ b/main/src/com/google/refine/model/changes/MassChange.java @@ -54,6 +54,7 @@ public class MassChange implements Change { _updateRowContextDependencies = updateRowContextDependencies; } + @Override public void apply(Project project) { synchronized (project) { for (Change change : _changes) { @@ -66,6 +67,7 @@ public class MassChange implements Change { } } + @Override public void revert(Project project) { synchronized (project) { for (Change change : _changes) { @@ -78,6 +80,7 @@ public class MassChange implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("updateRowContextDependencies="); writer.write(Boolean.toString(_updateRowContextDependencies)); writer.write('\n'); writer.write("changeCount="); writer.write(Integer.toString(_changes.size())); writer.write('\n'); diff --git a/main/src/com/google/refine/model/changes/MassReconChange.java b/main/src/com/google/refine/model/changes/MassReconChange.java index 49437173c..8e21e8fdb 100644 --- a/main/src/com/google/refine/model/changes/MassReconChange.java +++ b/main/src/com/google/refine/model/changes/MassReconChange.java @@ -59,10 +59,12 @@ public class MassReconChange implements Change { _oldRecons = oldRecons; } + @Override public void apply(Project project) { switchRecons(project, _newRecons); } + @Override public void revert(Project project) { switchRecons(project, _oldRecons); } @@ -86,6 +88,7 @@ public class MassReconChange implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { writeRecons(writer, options, _oldRecons, "oldReconCount"); writeRecons(writer, options, _newRecons, "newReconCount"); diff --git a/main/src/com/google/refine/model/changes/MassRowChange.java b/main/src/com/google/refine/model/changes/MassRowChange.java index 53b377fb7..eee70e46c 100644 --- a/main/src/com/google/refine/model/changes/MassRowChange.java +++ b/main/src/com/google/refine/model/changes/MassRowChange.java @@ -53,6 +53,7 @@ public class MassRowChange implements Change { _newRows = newRows; } + @Override public void apply(Project project) { synchronized (project) { _oldRows = new ArrayList(project.rows); @@ -63,6 +64,7 @@ public class MassRowChange implements Change { } } + @Override public void revert(Project project) { synchronized (project) { project.rows.clear(); @@ -72,6 +74,7 @@ public class MassRowChange implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("newRowCount="); writer.write(Integer.toString(_newRows.size())); writer.write('\n'); for (Row row : _newRows) { diff --git a/main/src/com/google/refine/model/changes/MassRowColumnChange.java b/main/src/com/google/refine/model/changes/MassRowColumnChange.java index 498df6fc2..979f7a548 100644 --- a/main/src/com/google/refine/model/changes/MassRowColumnChange.java +++ b/main/src/com/google/refine/model/changes/MassRowColumnChange.java @@ -60,6 +60,7 @@ public class MassRowColumnChange implements Change { _newRows = newRows; } + @Override public void apply(Project project) { synchronized (project) { if (_oldColumnGroups == null) { @@ -83,6 +84,7 @@ public class MassRowColumnChange implements Change { } } + @Override public void revert(Project project) { synchronized (project) { project.columnModel.columns.clear(); @@ -98,6 +100,7 @@ public class MassRowColumnChange implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("newColumnCount="); writer.write(Integer.toString(_newColumns.size())); writer.write('\n'); for (Column column : _newColumns) { diff --git a/main/src/com/google/refine/model/changes/ReconChange.java b/main/src/com/google/refine/model/changes/ReconChange.java index b3ef7f2a2..cf808d11c 100644 --- a/main/src/com/google/refine/model/changes/ReconChange.java +++ b/main/src/com/google/refine/model/changes/ReconChange.java @@ -124,6 +124,7 @@ public class ReconChange extends MassCellChange { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("newReconConfig="); if (_newReconConfig != null) { diff --git a/main/src/com/google/refine/model/changes/RowFlagChange.java b/main/src/com/google/refine/model/changes/RowFlagChange.java index 75bc44734..73855a889 100644 --- a/main/src/com/google/refine/model/changes/RowFlagChange.java +++ b/main/src/com/google/refine/model/changes/RowFlagChange.java @@ -53,6 +53,7 @@ public class RowFlagChange implements Change { this.newFlagged = newFlagged; } + @Override public void apply(Project project) { Row row = project.rows.get(rowIndex); if (oldFlagged == null) { @@ -61,12 +62,14 @@ public class RowFlagChange implements Change { row.flagged = newFlagged; } + @Override public void revert(Project project) { Row row = project.rows.get(rowIndex); row.flagged = oldFlagged; } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("row="); writer.write(Integer.toString(rowIndex)); writer.write('\n'); writer.write("newFlagged="); writer.write(Boolean.toString(newFlagged)); writer.write('\n'); diff --git a/main/src/com/google/refine/model/changes/RowRemovalChange.java b/main/src/com/google/refine/model/changes/RowRemovalChange.java index 77d36825e..b1f446fb2 100644 --- a/main/src/com/google/refine/model/changes/RowRemovalChange.java +++ b/main/src/com/google/refine/model/changes/RowRemovalChange.java @@ -53,6 +53,7 @@ public class RowRemovalChange implements Change { _rowIndices = rowIndices; } + @Override public void apply(Project project) { synchronized (project) { int count = _rowIndices.size(); @@ -73,6 +74,7 @@ public class RowRemovalChange implements Change { } } + @Override public void revert(Project project) { synchronized (project) { int count = _rowIndices.size(); @@ -88,6 +90,7 @@ public class RowRemovalChange implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("rowIndexCount="); writer.write(Integer.toString(_rowIndices.size())); writer.write('\n'); for (Integer index : _rowIndices) { diff --git a/main/src/com/google/refine/model/changes/RowReorderChange.java b/main/src/com/google/refine/model/changes/RowReorderChange.java index 169c20c28..c77fb2b4c 100644 --- a/main/src/com/google/refine/model/changes/RowReorderChange.java +++ b/main/src/com/google/refine/model/changes/RowReorderChange.java @@ -52,6 +52,7 @@ public class RowReorderChange implements Change { _rowIndices = rowIndices; } + @Override public void apply(Project project) { synchronized (project) { List oldRows = project.rows; @@ -67,6 +68,7 @@ public class RowReorderChange implements Change { } } + @Override public void revert(Project project) { synchronized (project) { int count = project.rows.size(); @@ -90,6 +92,7 @@ public class RowReorderChange implements Change { } } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("rowIndexCount="); writer.write(Integer.toString(_rowIndices.size())); writer.write('\n'); for (Integer index : _rowIndices) { diff --git a/main/src/com/google/refine/model/changes/RowStarChange.java b/main/src/com/google/refine/model/changes/RowStarChange.java index d04603561..bde382243 100644 --- a/main/src/com/google/refine/model/changes/RowStarChange.java +++ b/main/src/com/google/refine/model/changes/RowStarChange.java @@ -53,6 +53,7 @@ public class RowStarChange implements Change { this.newStarred = newStarred; } + @Override public void apply(Project project) { Row row = project.rows.get(rowIndex); if (oldStarred == null) { @@ -61,12 +62,14 @@ public class RowStarChange implements Change { row.starred = newStarred; } + @Override public void revert(Project project) { Row row = project.rows.get(rowIndex); row.starred = oldStarred; } + @Override public void save(Writer writer, Properties options) throws IOException { writer.write("row="); writer.write(Integer.toString(rowIndex)); writer.write('\n'); writer.write("newStarred="); writer.write(Boolean.toString(newStarred)); writer.write('\n'); diff --git a/main/src/com/google/refine/model/recon/StandardReconConfig.java b/main/src/com/google/refine/model/recon/StandardReconConfig.java index 80a0e5959..d9fcf2ca6 100644 --- a/main/src/com/google/refine/model/recon/StandardReconConfig.java +++ b/main/src/com/google/refine/model/recon/StandardReconConfig.java @@ -123,6 +123,7 @@ public class StandardReconConfig extends ReconConfig { String text; String code; + @Override public int getKey() { return code.hashCode(); } @@ -157,6 +158,7 @@ public class StandardReconConfig extends ReconConfig { this.columnDetails = columnDetails; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/oauth/Credentials.java b/main/src/com/google/refine/oauth/Credentials.java index 8818dccbc..8c628bf70 100644 --- a/main/src/com/google/refine/oauth/Credentials.java +++ b/main/src/com/google/refine/oauth/Credentials.java @@ -108,6 +108,7 @@ public class Credentials { return provider; } + @Override public String toString() { return TOKEN + "=" + OAuth.percentEncode(token) + "&" + SECRET + "=" + OAuth.percentEncode(secret); } diff --git a/main/src/com/google/refine/oauth/GoogleProvider.java b/main/src/com/google/refine/oauth/GoogleProvider.java index 70ce072d4..6a4b0453e 100644 --- a/main/src/com/google/refine/oauth/GoogleProvider.java +++ b/main/src/com/google/refine/oauth/GoogleProvider.java @@ -35,14 +35,17 @@ package com.google.refine.oauth; public class GoogleProvider extends Provider { + @Override public String getRequestTokenServiceURL() { return "https://www.google.com/accounts/OAuthGetRequestToken"; } + @Override public String getAccessTokenServiceURL() { return "https://www.google.com/accounts/OAuthGetAccessToken"; } + @Override public String getUserAuthorizationURL() { return "https://www.google.com/accounts/OAuthAuthorizeToken"; } diff --git a/main/src/com/google/refine/operations/EngineDependentMassCellOperation.java b/main/src/com/google/refine/operations/EngineDependentMassCellOperation.java index ab6120da2..bc5d4fab5 100644 --- a/main/src/com/google/refine/operations/EngineDependentMassCellOperation.java +++ b/main/src/com/google/refine/operations/EngineDependentMassCellOperation.java @@ -59,6 +59,7 @@ abstract public class EngineDependentMassCellOperation extends EngineDependentOp _updateRowContextDependencies = updateRowContextDependencies; } + @Override protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); diff --git a/main/src/com/google/refine/operations/cell/BlankDownOperation.java b/main/src/com/google/refine/operations/cell/BlankDownOperation.java index a45971134..bde30c22b 100644 --- a/main/src/com/google/refine/operations/cell/BlankDownOperation.java +++ b/main/src/com/google/refine/operations/cell/BlankDownOperation.java @@ -69,6 +69,7 @@ public class BlankDownOperation extends EngineDependentMassCellOperation { super(engineConfig, columnName, true); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -80,10 +81,12 @@ public class BlankDownOperation extends EngineDependentMassCellOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Blank down cells in column " + _columnName; } + @Override protected String createDescription(Column column, List cellChanges) { @@ -91,6 +94,7 @@ public class BlankDownOperation extends EngineDependentMassCellOperation { " cells in column " + column.getName(); } + @Override protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); @@ -115,6 +119,7 @@ public class BlankDownOperation extends EngineDependentMassCellOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Object value = row.getCellValue(cellIndex); if (ExpressionUtils.isNonBlankData(value)) { diff --git a/main/src/com/google/refine/operations/cell/FillDownOperation.java b/main/src/com/google/refine/operations/cell/FillDownOperation.java index 1a23f7f32..88c87e773 100644 --- a/main/src/com/google/refine/operations/cell/FillDownOperation.java +++ b/main/src/com/google/refine/operations/cell/FillDownOperation.java @@ -69,6 +69,7 @@ public class FillDownOperation extends EngineDependentMassCellOperation { super(engineConfig, columnName, true); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -80,10 +81,12 @@ public class FillDownOperation extends EngineDependentMassCellOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Fill down cells in column " + _columnName; } + @Override protected String createDescription(Column column, List cellChanges) { @@ -91,6 +94,7 @@ public class FillDownOperation extends EngineDependentMassCellOperation { " cells in column " + column.getName(); } + @Override protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); @@ -115,6 +119,7 @@ public class FillDownOperation extends EngineDependentMassCellOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Object value = row.getCellValue(cellIndex); if (ExpressionUtils.isNonBlankData(value)) { diff --git a/main/src/com/google/refine/operations/cell/MassEditOperation.java b/main/src/com/google/refine/operations/cell/MassEditOperation.java index 53225f0e9..03e976d3c 100644 --- a/main/src/com/google/refine/operations/cell/MassEditOperation.java +++ b/main/src/com/google/refine/operations/cell/MassEditOperation.java @@ -77,6 +77,7 @@ public class MassEditOperation extends EngineDependentMassCellOperation { this.to = to; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -149,6 +150,7 @@ public class MassEditOperation extends EngineDependentMassCellOperation { _edits = edits; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -167,10 +169,12 @@ public class MassEditOperation extends EngineDependentMassCellOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Mass edit cells in column " + _columnName; } + @Override protected String createDescription(Column column, List cellChanges) { @@ -178,6 +182,7 @@ public class MassEditOperation extends EngineDependentMassCellOperation { " cells in column " + column.getName(); } + @Override protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); @@ -241,6 +246,7 @@ public class MassEditOperation extends EngineDependentMassCellOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(cellIndex); Cell newCell = null; diff --git a/main/src/com/google/refine/operations/cell/MultiValuedCellJoinOperation.java b/main/src/com/google/refine/operations/cell/MultiValuedCellJoinOperation.java index 7aeec4671..8a7376894 100644 --- a/main/src/com/google/refine/operations/cell/MultiValuedCellJoinOperation.java +++ b/main/src/com/google/refine/operations/cell/MultiValuedCellJoinOperation.java @@ -74,6 +74,7 @@ public class MultiValuedCellJoinOperation extends AbstractOperation { _separator = separator; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -86,10 +87,12 @@ public class MultiValuedCellJoinOperation extends AbstractOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Join multi-valued cells in column " + _columnName; } + @Override protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); if (column == null) { diff --git a/main/src/com/google/refine/operations/cell/MultiValuedCellSplitOperation.java b/main/src/com/google/refine/operations/cell/MultiValuedCellSplitOperation.java index 53b06be3b..9f5a1ad06 100644 --- a/main/src/com/google/refine/operations/cell/MultiValuedCellSplitOperation.java +++ b/main/src/com/google/refine/operations/cell/MultiValuedCellSplitOperation.java @@ -78,7 +78,8 @@ public class MultiValuedCellSplitOperation extends AbstractOperation { _mode = mode; } - public void write(JSONWriter writer, Properties options) + @Override +public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); @@ -91,6 +92,7 @@ public class MultiValuedCellSplitOperation extends AbstractOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Split multi-valued cells in column " + _columnName; } diff --git a/main/src/com/google/refine/operations/cell/TextTransformOperation.java b/main/src/com/google/refine/operations/cell/TextTransformOperation.java index 5c67ef90a..262e7c4f8 100644 --- a/main/src/com/google/refine/operations/cell/TextTransformOperation.java +++ b/main/src/com/google/refine/operations/cell/TextTransformOperation.java @@ -109,6 +109,7 @@ public class TextTransformOperation extends EngineDependentMassCellOperation { _repeatCount = repeatCount; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -124,10 +125,12 @@ public class TextTransformOperation extends EngineDependentMassCellOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Text transform on cells in column " + _columnName + " using expression " + _expression; } + @Override protected String createDescription(Column column, List cellChanges) { @@ -135,6 +138,7 @@ public class TextTransformOperation extends EngineDependentMassCellOperation { " cells in column " + column.getName() + ": " + _expression; } + @Override protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); @@ -165,6 +169,7 @@ public class TextTransformOperation extends EngineDependentMassCellOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(cellIndex); Cell newCell = null; diff --git a/main/src/com/google/refine/operations/cell/TransposeColumnsIntoRowsOperation.java b/main/src/com/google/refine/operations/cell/TransposeColumnsIntoRowsOperation.java index d83640f0c..2ff30995c 100644 --- a/main/src/com/google/refine/operations/cell/TransposeColumnsIntoRowsOperation.java +++ b/main/src/com/google/refine/operations/cell/TransposeColumnsIntoRowsOperation.java @@ -85,7 +85,8 @@ public class TransposeColumnsIntoRowsOperation extends AbstractOperation { _ignoreBlankCells = ignoreBlankCells; } - public void write(JSONWriter writer, Properties options) + @Override +public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); @@ -100,6 +101,7 @@ public class TransposeColumnsIntoRowsOperation extends AbstractOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Transpose cells in " + _columnCount + " column(s) starting with " + _startColumnName + " into rows"; } diff --git a/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java b/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java index 5bdbc81b8..5470fd1ca 100644 --- a/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java +++ b/main/src/com/google/refine/operations/cell/TransposeRowsIntoColumnsOperation.java @@ -69,7 +69,8 @@ public class TransposeRowsIntoColumnsOperation extends AbstractOperation { _rowCount = rowCount; } - public void write(JSONWriter writer, Properties options) + @Override +public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); @@ -80,6 +81,7 @@ public class TransposeRowsIntoColumnsOperation extends AbstractOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Transpose every " + _rowCount + " cells in column " + _columnName + " into separate columns"; } diff --git a/main/src/com/google/refine/operations/column/ColumnAdditionByFetchingURLsOperation.java b/main/src/com/google/refine/operations/column/ColumnAdditionByFetchingURLsOperation.java index a18c20cb6..0029baa9a 100644 --- a/main/src/com/google/refine/operations/column/ColumnAdditionByFetchingURLsOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnAdditionByFetchingURLsOperation.java @@ -113,6 +113,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat _delay = delay; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -129,6 +130,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Create column " + _newColumnName + " at index " + _columnInsertIndex + @@ -144,6 +146,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat } + @Override public Process createProcess(Project project, Properties options) throws Exception { Column column = project.columnModel.getColumnByName(_baseColumnName); if (column == null) { @@ -186,6 +189,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat _historyEntryID = HistoryEntry.allocateID(); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -198,10 +202,12 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat writer.endObject(); } + @Override protected Runnable getRunnable() { return this; } + @Override public void run() { List urls = new ArrayList(_project.rows.size()); @@ -292,6 +298,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(cellIndex); Cell newCell = null; diff --git a/main/src/com/google/refine/operations/column/ColumnAdditionOperation.java b/main/src/com/google/refine/operations/column/ColumnAdditionOperation.java index aa06bd5f6..9b0182b01 100644 --- a/main/src/com/google/refine/operations/column/ColumnAdditionOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnAdditionOperation.java @@ -102,6 +102,7 @@ public class ColumnAdditionOperation extends EngineDependentOperation { _columnInsertIndex = columnInsertIndex; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -117,6 +118,7 @@ public class ColumnAdditionOperation extends EngineDependentOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Create column " + _newColumnName + " at index " + _columnInsertIndex + @@ -131,6 +133,7 @@ public class ColumnAdditionOperation extends EngineDependentOperation { " rows with " + _expression; } + @Override protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); @@ -185,6 +188,7 @@ public class ColumnAdditionOperation extends EngineDependentOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(cellIndex); Cell newCell = null; diff --git a/main/src/com/google/refine/operations/column/ColumnMoveOperation.java b/main/src/com/google/refine/operations/column/ColumnMoveOperation.java index 308befbab..615fac945 100644 --- a/main/src/com/google/refine/operations/column/ColumnMoveOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnMoveOperation.java @@ -65,7 +65,8 @@ public class ColumnMoveOperation extends AbstractOperation { _index = index; } - public void write(JSONWriter writer, Properties options) + @Override +public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); @@ -77,10 +78,12 @@ public class ColumnMoveOperation extends AbstractOperation { } + @Override protected String getBriefDescription(Project project) { return "Move column " + _columnName + " to position " + _index; } + @Override protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { if (project.columnModel.getColumnByName(_columnName) == null) { throw new Exception("No column named " + _columnName); diff --git a/main/src/com/google/refine/operations/column/ColumnRemovalOperation.java b/main/src/com/google/refine/operations/column/ColumnRemovalOperation.java index 30d10e518..c9b68a701 100644 --- a/main/src/com/google/refine/operations/column/ColumnRemovalOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnRemovalOperation.java @@ -62,7 +62,8 @@ public class ColumnRemovalOperation extends AbstractOperation { _columnName = columnName; } - public void write(JSONWriter writer, Properties options) + @Override +public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); @@ -73,10 +74,12 @@ public class ColumnRemovalOperation extends AbstractOperation { } + @Override protected String getBriefDescription(Project project) { return "Remove column " + _columnName; } + @Override protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); if (column == null) { diff --git a/main/src/com/google/refine/operations/column/ColumnRenameOperation.java b/main/src/com/google/refine/operations/column/ColumnRenameOperation.java index 307d2da18..1913bbacc 100644 --- a/main/src/com/google/refine/operations/column/ColumnRenameOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnRenameOperation.java @@ -65,7 +65,8 @@ public class ColumnRenameOperation extends AbstractOperation { _newColumnName = newColumnName; } - public void write(JSONWriter writer, Properties options) + @Override +public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); @@ -77,10 +78,12 @@ public class ColumnRenameOperation extends AbstractOperation { } + @Override protected String getBriefDescription(Project project) { return "Rename column " + _oldColumnName + " to " + _newColumnName; } + @Override protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { if (project.columnModel.getColumnByName(_oldColumnName) == null) { throw new Exception("No column named " + _oldColumnName); diff --git a/main/src/com/google/refine/operations/column/ColumnReorderOperation.java b/main/src/com/google/refine/operations/column/ColumnReorderOperation.java index a4f96608c..4920b2e5e 100644 --- a/main/src/com/google/refine/operations/column/ColumnReorderOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnReorderOperation.java @@ -63,6 +63,7 @@ public class ColumnReorderOperation extends AbstractOperation { _columnNames = columnNames; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -77,11 +78,13 @@ public class ColumnReorderOperation extends AbstractOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Reorder columns"; } - protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { + @Override +protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { return new HistoryEntry( historyEntryID, project, diff --git a/main/src/com/google/refine/operations/column/ColumnSplitOperation.java b/main/src/com/google/refine/operations/column/ColumnSplitOperation.java index 801e0c274..9d4aaadbc 100644 --- a/main/src/com/google/refine/operations/column/ColumnSplitOperation.java +++ b/main/src/com/google/refine/operations/column/ColumnSplitOperation.java @@ -141,6 +141,7 @@ public class ColumnSplitOperation extends EngineDependentOperation { _fieldLengths = fieldLengths; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -166,11 +167,13 @@ public class ColumnSplitOperation extends EngineDependentOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Split column " + _columnName + ("separator".equals(_mode) ? " by separator" : " by field lengths"); } + @Override protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); @@ -187,6 +190,7 @@ public class ColumnSplitOperation extends EngineDependentOperation { RowVisitor rowVisitor; if ("lengths".equals(_mode)) { rowVisitor = new ColumnSplitRowVisitor(column.getCellIndex(), columnNames, rowIndices, tuples) { + @Override protected java.util.List split(String s) { List results = new ArrayList(_fieldLengths.length + 1); @@ -210,6 +214,7 @@ public class ColumnSplitOperation extends EngineDependentOperation { rowVisitor = new ColumnSplitRowVisitor(column.getCellIndex(), columnNames, rowIndices, tuples) { Pattern _pattern; + @Override protected java.util.List split(String s) { return stringArrayToValueList(_pattern.split(s, _maxColumns)); }; @@ -221,6 +226,7 @@ public class ColumnSplitOperation extends EngineDependentOperation { }.init(pattern); } else { rowVisitor = new ColumnSplitRowVisitor(column.getCellIndex(), columnNames, rowIndices, tuples) { + @Override protected java.util.List split(String s) { return stringArrayToValueList( StringUtils.splitByWholeSeparatorPreserveAllTokens(s, _separator, _maxColumns)); @@ -279,6 +285,7 @@ public class ColumnSplitOperation extends EngineDependentOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Object value = row.getCellValue(cellIndex); if (ExpressionUtils.isNonBlankData(value)) { diff --git a/main/src/com/google/refine/operations/recon/ReconClearSimilarCellsOperation.java b/main/src/com/google/refine/operations/recon/ReconClearSimilarCellsOperation.java index 9da0b5e8b..40b51f442 100644 --- a/main/src/com/google/refine/operations/recon/ReconClearSimilarCellsOperation.java +++ b/main/src/com/google/refine/operations/recon/ReconClearSimilarCellsOperation.java @@ -73,6 +73,7 @@ public class ReconClearSimilarCellsOperation extends EngineDependentMassCellOper this._similarValue = similarValue; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -86,11 +87,13 @@ public class ReconClearSimilarCellsOperation extends EngineDependentMassCellOper writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Clear recon data for cells containing \"" + _similarValue + "\" in column " + _columnName; } + @Override protected String createDescription(Column column, List cellChanges) { @@ -98,6 +101,7 @@ public class ReconClearSimilarCellsOperation extends EngineDependentMassCellOper _similarValue + "\" in column " + _columnName; } + @Override protected RowVisitor createRowVisitor(final Project project, final List cellChanges, final long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); final int cellIndex = column != null ? column.getCellIndex() : -1; @@ -113,6 +117,7 @@ public class ReconClearSimilarCellsOperation extends EngineDependentMassCellOper // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = cellIndex < 0 ? null : row.getCell(cellIndex); if (cell != null && cell.recon != null) { @@ -131,6 +136,7 @@ public class ReconClearSimilarCellsOperation extends EngineDependentMassCellOper }; } + @Override protected Change createChange(Project project, Column column, List cellChanges) { return new ReconChange( cellChanges, diff --git a/main/src/com/google/refine/operations/recon/ReconCopyAcrossColumnsOperation.java b/main/src/com/google/refine/operations/recon/ReconCopyAcrossColumnsOperation.java index 5f7a2ec6e..9c02e6ad7 100644 --- a/main/src/com/google/refine/operations/recon/ReconCopyAcrossColumnsOperation.java +++ b/main/src/com/google/refine/operations/recon/ReconCopyAcrossColumnsOperation.java @@ -93,6 +93,7 @@ public class ReconCopyAcrossColumnsOperation extends EngineDependentOperation { _applyToJudgedCells = applyToJudgedCells; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -117,6 +118,7 @@ public class ReconCopyAcrossColumnsOperation extends EngineDependentOperation { writer.endObject(); } + @Override protected HistoryEntry createHistoryEntry(final Project project, final long historyEntryID) throws Exception { Engine engine = createEngine(project); @@ -153,6 +155,7 @@ public class ReconCopyAcrossColumnsOperation extends EngineDependentOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(fromColumn.getCellIndex()); if (cell != null && cell.value != null && cell.recon != null) { @@ -175,6 +178,7 @@ public class ReconCopyAcrossColumnsOperation extends EngineDependentOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { for (Column column : toColumns) { int cellIndex = column.getCellIndex(); @@ -205,6 +209,7 @@ public class ReconCopyAcrossColumnsOperation extends EngineDependentOperation { historyEntryID, project, description, this, new MassChange(cellChanges, false)); } + @Override protected String getBriefDescription(Project project) { return "Copy recon judgments from column " + _fromColumnName + " to " + StringUtils.join(_toColumnNames); diff --git a/main/src/com/google/refine/operations/recon/ReconDiscardJudgmentsOperation.java b/main/src/com/google/refine/operations/recon/ReconDiscardJudgmentsOperation.java index f2519b13f..cb36ad2ad 100644 --- a/main/src/com/google/refine/operations/recon/ReconDiscardJudgmentsOperation.java +++ b/main/src/com/google/refine/operations/recon/ReconDiscardJudgmentsOperation.java @@ -73,6 +73,7 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera _clearData = clearData; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -85,12 +86,14 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return _clearData ? "Discard recon judgments and clear recon data for cells in column " + _columnName : "Discard recon judgments for cells in column " + _columnName; } + @Override protected String createDescription(Column column, List cellChanges) { @@ -100,6 +103,7 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera " for " + cellChanges.size() + " cells in column " + column.getName(); } + @Override protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); @@ -126,6 +130,7 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(cellIndex); if (cell != null && cell.recon != null) { @@ -156,6 +161,7 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera }.init(column.getCellIndex(), cellChanges, historyEntryID); } + @Override protected Change createChange(Project project, Column column, List cellChanges) { return new ReconChange( cellChanges, diff --git a/main/src/com/google/refine/operations/recon/ReconJudgeSimilarCellsOperation.java b/main/src/com/google/refine/operations/recon/ReconJudgeSimilarCellsOperation.java index 5fbf4e37f..44993a201 100644 --- a/main/src/com/google/refine/operations/recon/ReconJudgeSimilarCellsOperation.java +++ b/main/src/com/google/refine/operations/recon/ReconJudgeSimilarCellsOperation.java @@ -116,6 +116,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper this._shareNewTopics = shareNewTopics; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -134,6 +135,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper writer.endObject(); } + @Override protected String getBriefDescription(Project project) { if (_judgment == Judgment.None) { return "Discard recon judgments for cells containing \"" + @@ -155,6 +157,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper throw new InternalError("Can't get here"); } + @Override protected String createDescription(Column column, List cellChanges) { @@ -179,6 +182,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper throw new InternalError("Can't get here"); } + @Override protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); @@ -206,6 +210,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(_cellIndex); if (cell != null && ExpressionUtils.isNonBlankData(cell.value)) { @@ -270,6 +275,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper } + @Override protected Change createChange(Project project, Column column, List cellChanges) { return new ReconChange( cellChanges, diff --git a/main/src/com/google/refine/operations/recon/ReconMarkNewTopicsOperation.java b/main/src/com/google/refine/operations/recon/ReconMarkNewTopicsOperation.java index fa8085f3f..1f2071b61 100644 --- a/main/src/com/google/refine/operations/recon/ReconMarkNewTopicsOperation.java +++ b/main/src/com/google/refine/operations/recon/ReconMarkNewTopicsOperation.java @@ -74,6 +74,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio _shareNewTopics = shareNewTopics; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -86,6 +87,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Mark to create new topics for cells in column " + _columnName + (_shareNewTopics ? @@ -93,6 +95,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio ", one topic for each cell"); } + @Override protected String createDescription(Column column, List cellChanges) { @@ -103,6 +106,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio ", one topic for each cell"); } + @Override protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); @@ -129,6 +133,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(cellIndex); if (cell != null) { @@ -165,6 +170,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio }.init(column.getCellIndex(), cellChanges, historyEntryID); } + @Override protected Change createChange(Project project, Column column, List cellChanges) { return new ReconChange( cellChanges, diff --git a/main/src/com/google/refine/operations/recon/ReconMatchBestCandidatesOperation.java b/main/src/com/google/refine/operations/recon/ReconMatchBestCandidatesOperation.java index 2cc20b5eb..e149cffe2 100644 --- a/main/src/com/google/refine/operations/recon/ReconMatchBestCandidatesOperation.java +++ b/main/src/com/google/refine/operations/recon/ReconMatchBestCandidatesOperation.java @@ -72,6 +72,7 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp super(engineConfig, columnName, false); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -83,10 +84,12 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Match each cell to its best recon candidate in column " + _columnName; } + @Override protected String createDescription(Column column, List cellChanges) { @@ -94,6 +97,7 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp " cells to its best candidate in column " + column.getName(); } + @Override protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); @@ -120,6 +124,7 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { if (cellIndex < row.cells.size()) { Cell cell = row.cells.get(cellIndex); @@ -155,6 +160,7 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp }.init(column.getCellIndex(), cellChanges, historyEntryID); } + @Override protected Change createChange(Project project, Column column, List cellChanges) { return new ReconChange( cellChanges, diff --git a/main/src/com/google/refine/operations/recon/ReconMatchSpecificTopicOperation.java b/main/src/com/google/refine/operations/recon/ReconMatchSpecificTopicOperation.java index 134755397..75270aa6b 100644 --- a/main/src/com/google/refine/operations/recon/ReconMatchSpecificTopicOperation.java +++ b/main/src/com/google/refine/operations/recon/ReconMatchSpecificTopicOperation.java @@ -101,6 +101,7 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe this.schemaSpace = schemaSpace; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -125,12 +126,14 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Match specific topic " + match.name + " (" + match.id + ") to cells in column " + _columnName; } + @Override protected String createDescription(Column column, List cellChanges) { return "Match specific topic " + @@ -139,6 +142,7 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe " cells in column " + column.getName(); } + @Override protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); @@ -165,6 +169,7 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { Cell cell = row.getCell(cellIndex); if (cell != null) { @@ -204,6 +209,7 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe }.init(column.getCellIndex(), cellChanges, historyEntryID); } + @Override protected Change createChange(Project project, Column column, List cellChanges) { return new ReconChange( cellChanges, diff --git a/main/src/com/google/refine/operations/recon/ReconOperation.java b/main/src/com/google/refine/operations/recon/ReconOperation.java index 9bec6089f..f0bb18c7f 100644 --- a/main/src/com/google/refine/operations/recon/ReconOperation.java +++ b/main/src/com/google/refine/operations/recon/ReconOperation.java @@ -93,6 +93,7 @@ public class ReconOperation extends EngineDependentOperation { _reconConfig = reconConfig; } + @Override public Process createProcess(Project project, Properties options) throws Exception { return new ReconProcess( project, @@ -101,10 +102,12 @@ public class ReconOperation extends EngineDependentOperation { ); } + @Override protected String getBriefDescription(Project project) { return _reconConfig.getBriefDescription(project, _columnName); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -154,6 +157,7 @@ public class ReconOperation extends EngineDependentOperation { _historyEntryID = HistoryEntry.allocateID(); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -197,6 +201,7 @@ public class ReconOperation extends EngineDependentOperation { writer.endObject(); } + @Override protected Runnable getRunnable() { return this; } @@ -225,6 +230,7 @@ public class ReconOperation extends EngineDependentOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { if (_cellIndex < row.cells.size()) { Cell cell = row.cells.get(_cellIndex); @@ -237,6 +243,7 @@ public class ReconOperation extends EngineDependentOperation { }); } + @Override public void run() { try { populateEntries(); diff --git a/main/src/com/google/refine/operations/row/DenormalizeOperation.java b/main/src/com/google/refine/operations/row/DenormalizeOperation.java index c98cb4edd..67aa297d7 100644 --- a/main/src/com/google/refine/operations/row/DenormalizeOperation.java +++ b/main/src/com/google/refine/operations/row/DenormalizeOperation.java @@ -59,7 +59,8 @@ public class DenormalizeOperation extends AbstractOperation { public DenormalizeOperation() { } - public void write(JSONWriter writer, Properties options) + @Override +public void write(JSONWriter writer, Properties options) throws JSONException { writer.object(); @@ -69,10 +70,12 @@ public class DenormalizeOperation extends AbstractOperation { } + @Override protected String getBriefDescription(Project project) { return "Denormalize"; } + @Override protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { List newRows = new ArrayList(); diff --git a/main/src/com/google/refine/operations/row/RowFlagOperation.java b/main/src/com/google/refine/operations/row/RowFlagOperation.java index e0478035a..2628abf04 100644 --- a/main/src/com/google/refine/operations/row/RowFlagOperation.java +++ b/main/src/com/google/refine/operations/row/RowFlagOperation.java @@ -72,6 +72,7 @@ public class RowFlagOperation extends EngineDependentOperation { _flagged = flagged; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -83,11 +84,13 @@ public class RowFlagOperation extends EngineDependentOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return (_flagged ? "Flag rows" : "Unflag rows"); } - protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { + @Override +protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); List changes = new ArrayList(project.rows.size()); @@ -123,6 +126,7 @@ public class RowFlagOperation extends EngineDependentOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { if (row.flagged != _flagged) { RowFlagChange change = new RowFlagChange(rowIndex, _flagged); diff --git a/main/src/com/google/refine/operations/row/RowRemovalOperation.java b/main/src/com/google/refine/operations/row/RowRemovalOperation.java index 60015e8be..f41ecf3af 100644 --- a/main/src/com/google/refine/operations/row/RowRemovalOperation.java +++ b/main/src/com/google/refine/operations/row/RowRemovalOperation.java @@ -65,6 +65,7 @@ public class RowRemovalOperation extends EngineDependentOperation { super(engineConfig); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -75,11 +76,13 @@ public class RowRemovalOperation extends EngineDependentOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Remove rows"; } - protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { + @Override +protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); List rowIndices = new ArrayList(); @@ -115,6 +118,7 @@ public class RowRemovalOperation extends EngineDependentOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { rowIndices.add(rowIndex); diff --git a/main/src/com/google/refine/operations/row/RowReorderOperation.java b/main/src/com/google/refine/operations/row/RowReorderOperation.java index 09fca6f97..bc65d18e7 100644 --- a/main/src/com/google/refine/operations/row/RowReorderOperation.java +++ b/main/src/com/google/refine/operations/row/RowReorderOperation.java @@ -72,6 +72,7 @@ public class RowReorderOperation extends AbstractOperation { _sorting = sorting; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -83,11 +84,13 @@ public class RowReorderOperation extends AbstractOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return "Reorder rows"; } - protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { + @Override +protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = new Engine(project); engine.setMode(_mode); diff --git a/main/src/com/google/refine/operations/row/RowStarOperation.java b/main/src/com/google/refine/operations/row/RowStarOperation.java index 1d45d19bb..f293f95a5 100644 --- a/main/src/com/google/refine/operations/row/RowStarOperation.java +++ b/main/src/com/google/refine/operations/row/RowStarOperation.java @@ -72,6 +72,7 @@ public class RowStarOperation extends EngineDependentOperation { _starred = starred; } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { @@ -83,11 +84,13 @@ public class RowStarOperation extends EngineDependentOperation { writer.endObject(); } + @Override protected String getBriefDescription(Project project) { return (_starred ? "Star rows" : "Unstar rows"); } - protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { + @Override +protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); List changes = new ArrayList(project.rows.size()); @@ -123,6 +126,7 @@ public class RowStarOperation extends EngineDependentOperation { // nothing to do } + @Override public boolean visit(Project project, int rowIndex, Row row) { if (row.starred != _starred) { RowStarChange change = new RowStarChange(rowIndex, _starred); diff --git a/main/src/com/google/refine/process/LongRunningProcess.java b/main/src/com/google/refine/process/LongRunningProcess.java index d89cabcfb..b05b6e876 100644 --- a/main/src/com/google/refine/process/LongRunningProcess.java +++ b/main/src/com/google/refine/process/LongRunningProcess.java @@ -51,6 +51,7 @@ abstract public class LongRunningProcess extends Process { _description = description; } + @Override public void cancel() { _canceled = true; if (_thread != null && _thread.isAlive()) { @@ -58,6 +59,7 @@ abstract public class LongRunningProcess extends Process { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/process/ProcessManager.java b/main/src/com/google/refine/process/ProcessManager.java index b5715f594..bbc11328d 100644 --- a/main/src/com/google/refine/process/ProcessManager.java +++ b/main/src/com/google/refine/process/ProcessManager.java @@ -51,6 +51,7 @@ public class ProcessManager implements Jsonizable { } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/process/QuickHistoryEntryProcess.java b/main/src/com/google/refine/process/QuickHistoryEntryProcess.java index 2dff386bc..96ed346b4 100644 --- a/main/src/com/google/refine/process/QuickHistoryEntryProcess.java +++ b/main/src/com/google/refine/process/QuickHistoryEntryProcess.java @@ -52,18 +52,22 @@ abstract public class QuickHistoryEntryProcess extends Process { _briefDescription = briefDescription; } + @Override public void cancel() { throw new RuntimeException("Not a long-running process"); } + @Override public boolean isImmediate() { return true; } + @Override public boolean isRunning() { throw new RuntimeException("Not a long-running process"); } + @Override public HistoryEntry performImmediate() throws Exception { if (_historyEntry == null) { _historyEntry = createHistoryEntry(HistoryEntry.allocateID()); @@ -74,10 +78,12 @@ abstract public class QuickHistoryEntryProcess extends Process { return _historyEntry; } + @Override public void startPerforming(ProcessManager manager) { throw new RuntimeException("Not a long-running process"); } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/src/com/google/refine/templating/Template.java b/main/src/com/google/refine/templating/Template.java index bc2df6ae2..44ef2731e 100644 --- a/main/src/com/google/refine/templating/Template.java +++ b/main/src/com/google/refine/templating/Template.java @@ -117,6 +117,7 @@ public class Template { } } + @Override public boolean visit(Project project, int rowIndex, Row row) { if (limit <= 0 || total < limit) { internalVisit(project, rowIndex, row); diff --git a/main/src/com/google/refine/util/Pool.java b/main/src/com/google/refine/util/Pool.java index 1f553a968..7f9373ab2 100644 --- a/main/src/com/google/refine/util/Pool.java +++ b/main/src/com/google/refine/util/Pool.java @@ -164,6 +164,7 @@ public class Pool implements Jsonizable { } } + @Override public void write(JSONWriter writer, Properties options) throws JSONException { diff --git a/main/tests/server/src/com/google/refine/tests/ProjectManagerTests.java b/main/tests/server/src/com/google/refine/tests/ProjectManagerTests.java index 93b363c3b..78c0e4d0a 100644 --- a/main/tests/server/src/com/google/refine/tests/ProjectManagerTests.java +++ b/main/tests/server/src/com/google/refine/tests/ProjectManagerTests.java @@ -62,6 +62,7 @@ public class ProjectManagerTests extends RefineTest { Project project; ProjectMetadata metadata; + @Override @BeforeTest public void init() { logger = LoggerFactory.getLogger(this.getClass()); diff --git a/main/tests/server/src/com/google/refine/tests/RefineServletTests.java b/main/tests/server/src/com/google/refine/tests/RefineServletTests.java index d00da3f11..f1894f6cd 100644 --- a/main/tests/server/src/com/google/refine/tests/RefineServletTests.java +++ b/main/tests/server/src/com/google/refine/tests/RefineServletTests.java @@ -55,6 +55,7 @@ import com.google.refine.commands.Command; public class RefineServletTests extends RefineTest { + @Override @BeforeTest public void init() { logger = LoggerFactory.getLogger(this.getClass()); diff --git a/main/tests/server/src/com/google/refine/tests/commands/CommandTests.java b/main/tests/server/src/com/google/refine/tests/commands/CommandTests.java index 605353680..8c0c9dcba 100644 --- a/main/tests/server/src/com/google/refine/tests/commands/CommandTests.java +++ b/main/tests/server/src/com/google/refine/tests/commands/CommandTests.java @@ -57,6 +57,7 @@ import com.google.refine.tests.RefineTest; public class CommandTests extends RefineTest { + @Override @BeforeTest public void init() { logger = LoggerFactory.getLogger(this.getClass()); diff --git a/main/tests/server/src/com/google/refine/tests/commands/util/CancelProcessesCommandTests.java b/main/tests/server/src/com/google/refine/tests/commands/util/CancelProcessesCommandTests.java index 746fb7e9d..350d45a9b 100644 --- a/main/tests/server/src/com/google/refine/tests/commands/util/CancelProcessesCommandTests.java +++ b/main/tests/server/src/com/google/refine/tests/commands/util/CancelProcessesCommandTests.java @@ -61,6 +61,7 @@ import com.google.refine.tests.RefineTest; public class CancelProcessesCommandTests extends RefineTest { + @Override @BeforeTest public void init() { logger = LoggerFactory.getLogger(this.getClass()); diff --git a/main/tests/server/src/com/google/refine/tests/exporters/CsvExporterTests.java b/main/tests/server/src/com/google/refine/tests/exporters/CsvExporterTests.java index dc130ef78..a6ea9dae7 100644 --- a/main/tests/server/src/com/google/refine/tests/exporters/CsvExporterTests.java +++ b/main/tests/server/src/com/google/refine/tests/exporters/CsvExporterTests.java @@ -63,6 +63,7 @@ import com.google.refine.util.ParsingUtilities; public class CsvExporterTests extends RefineTest { + @Override @BeforeTest public void init() { logger = LoggerFactory.getLogger(this.getClass()); diff --git a/main/tests/server/src/com/google/refine/tests/exporters/HtmlExporterTests.java b/main/tests/server/src/com/google/refine/tests/exporters/HtmlExporterTests.java index 4a7662679..f98901862 100644 --- a/main/tests/server/src/com/google/refine/tests/exporters/HtmlExporterTests.java +++ b/main/tests/server/src/com/google/refine/tests/exporters/HtmlExporterTests.java @@ -66,6 +66,7 @@ public class HtmlExporterTests extends RefineTest { private static final String TEST_PROJECT_NAME = "html table exporter test project"; + @Override @BeforeTest public void init() { logger = LoggerFactory.getLogger(this.getClass()); diff --git a/main/tests/server/src/com/google/refine/tests/exporters/TemplatingExporterTests.java b/main/tests/server/src/com/google/refine/tests/exporters/TemplatingExporterTests.java index d0ac518b6..25dc7aaf3 100644 --- a/main/tests/server/src/com/google/refine/tests/exporters/TemplatingExporterTests.java +++ b/main/tests/server/src/com/google/refine/tests/exporters/TemplatingExporterTests.java @@ -70,6 +70,7 @@ public class TemplatingExporterTests extends RefineTest { String suffix = " found) { baseDir.listFiles(new FileFilter() { + @Override public boolean accept(File pathname) { if (pathname.isDirectory()) { findFiles(extension, pathname, found); @@ -461,6 +463,7 @@ class RefineClient extends JFrame implements ActionListener { openBrowser(); } + @Override public void actionPerformed(ActionEvent e) { String item = e.getActionCommand(); if (item.startsWith("Open")) { @@ -485,6 +488,7 @@ class ShutdownSignalHandler implements Runnable { this._server = server; } + @Override public void run() { // Tell the server we want to try and shutdown gracefully diff --git a/server/src/com/google/util/logging/IndentingLayout.java b/server/src/com/google/util/logging/IndentingLayout.java index e6ac2baa8..94f8edb93 100644 --- a/server/src/com/google/util/logging/IndentingLayout.java +++ b/server/src/com/google/util/logging/IndentingLayout.java @@ -52,10 +52,12 @@ public class IndentingLayout extends Layout { protected long previousTime = 0; protected int indentation = 0; + @Override public void activateOptions() { // no options at this time } + @Override public String format(LoggingEvent event) { String message = event.getRenderedMessage(); if (message == null) return ""; @@ -137,6 +139,7 @@ public class IndentingLayout extends Layout { } } + @Override public boolean ignoresThrowable() { return true; } diff --git a/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java b/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java index 61d047722..70e14a262 100644 --- a/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java +++ b/server/src/com/google/util/threads/ThreadPoolExecutorAdapter.java @@ -35,6 +35,7 @@ public class ThreadPoolExecutorAdapter implements ThreadPool, LifeCycle { this.executor = executor; } + @Override public boolean dispatch(Runnable job) { try { executor.execute(job); @@ -45,46 +46,57 @@ public class ThreadPoolExecutorAdapter implements ThreadPool, LifeCycle { } } + @Override public int getIdleThreads() { return executor.getPoolSize() - executor.getActiveCount(); } + @Override public int getThreads() { return executor.getPoolSize(); } + @Override public boolean isLowOnThreads() { return executor.getActiveCount() >= executor.getMaximumPoolSize(); } + @Override public void join() throws InterruptedException { executor.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } + @Override public boolean isFailed() { return false; } + @Override public boolean isRunning() { return !executor.isTerminated() && !executor.isTerminating(); } + @Override public boolean isStarted() { return !executor.isTerminated() && !executor.isTerminating(); } + @Override public boolean isStarting() { return false; } + @Override public boolean isStopped() { return executor.isTerminated(); } + @Override public boolean isStopping() { return executor.isTerminating(); } + @Override public void start() throws Exception { if (executor.isTerminated() || executor.isTerminating() || executor.isShutdown()) { @@ -92,6 +104,7 @@ public class ThreadPoolExecutorAdapter implements ThreadPool, LifeCycle { } } + @Override public void stop() throws Exception { executor.shutdown(); if (!executor.awaitTermination(60, TimeUnit.SECONDS)) { @@ -99,10 +112,12 @@ public class ThreadPoolExecutorAdapter implements ThreadPool, LifeCycle { } } + @Override public void addLifeCycleListener(Listener listener) { System.err.println("we should implement this!"); } + @Override public void removeLifeCycleListener(Listener listener) { System.err.println("we should implement this!"); }