Add missing @Override annotations
git-svn-id: http://google-refine.googlecode.com/svn/trunk@2171 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
78edff6f7f
commit
123614539d
10
README.txt
10
README.txt
@ -52,8 +52,14 @@ This is the full list of contributors (in chronological order):
|
|||||||
- Iain Sproat <iainsproat@gmail.com>
|
- Iain Sproat <iainsproat@gmail.com>
|
||||||
- Tom Morris <tfmorris@gmail.com>
|
- Tom Morris <tfmorris@gmail.com>
|
||||||
- Heather Campbell <campbellh@google.com>
|
- Heather Campbell <campbellh@google.com>
|
||||||
|
- Thad Guidry <thadguidry@gmail.com>
|
||||||
|
- Paul Makepeace <paulm@paulm.com>
|
||||||
|
- Tomaž Šolc <tomaz.solc@zemanta.com>
|
||||||
|
- Gabriel Sjoberg <GabrielSjoberg@gmail.com>
|
||||||
|
- Rod Salazar <rodrod.salazar@gmail.com>
|
||||||
|
- pxb <pxb1988@gmail.com>
|
||||||
|
|
||||||
|
We welcome additional contributors if you'd like to help out.
|
||||||
- o -
|
- o -
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ public class FreebaseTopic implements Jsonizable {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ public class FreebaseType extends FreebaseTopic implements Jsonizable {
|
|||||||
super(id, name);
|
super(id, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ abstract public class ProtographTransposeExporter implements WriterExporter {
|
|||||||
_contentType = contentType;
|
_contentType = contentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return "application/x-unknown";
|
return "application/x-unknown";
|
||||||
}
|
}
|
||||||
@ -67,6 +68,7 @@ abstract public class ProtographTransposeExporter implements WriterExporter {
|
|||||||
throw new RuntimeException("Not implemented");
|
throw new RuntimeException("Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void export(Project project, Properties options, Engine engine,
|
public void export(Project project, Properties options, Engine engine,
|
||||||
Writer writer) throws IOException {
|
Writer writer) throws IOException {
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ public class CheckAuthorizationCommand extends Command {
|
|||||||
|
|
||||||
final static Logger logger = LoggerFactory.getLogger("check-authorization_command");
|
final static Logger logger = LoggerFactory.getLogger("check-authorization_command");
|
||||||
|
|
||||||
|
@Override
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -53,6 +53,7 @@ public class MqlKeyQuote implements Function {
|
|||||||
final static private Pattern fullValidKeyPattern = Pattern.compile(fullValidKey);
|
final static private Pattern fullValidKeyPattern = Pattern.compile(fullValidKey);
|
||||||
final static private Pattern keyCharMustQuotePattern = Pattern.compile(keyCharMustQuote);
|
final static private Pattern keyCharMustQuotePattern = Pattern.compile(keyCharMustQuote);
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
Object o1 = args[0];
|
Object o1 = args[0];
|
||||||
@ -63,6 +64,7 @@ public class MqlKeyQuote implements Function {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ import com.google.refine.grel.Function;
|
|||||||
public class MqlKeyUnquote implements Function {
|
public class MqlKeyUnquote implements Function {
|
||||||
final static private Pattern quotedCharPattern = Pattern.compile("\\$([0-9A-Fa-f]{4})");
|
final static private Pattern quotedCharPattern = Pattern.compile("\\$([0-9A-Fa-f]{4})");
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
Object o1 = args[0];
|
Object o1 = args[0];
|
||||||
@ -75,6 +76,7 @@ public class MqlKeyUnquote implements Function {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -126,6 +126,7 @@ public class DataExtensionChange implements Change {
|
|||||||
_newRows = newRows;
|
_newRows = newRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void apply(Project project) {
|
public void apply(Project project) {
|
||||||
synchronized (project) {
|
synchronized (project) {
|
||||||
if (_firstNewCellIndex < 0) {
|
if (_firstNewCellIndex < 0) {
|
||||||
@ -257,6 +258,7 @@ public class DataExtensionChange implements Change {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void revert(Project project) {
|
public void revert(Project project) {
|
||||||
synchronized (project) {
|
synchronized (project) {
|
||||||
project.rows.clear();
|
project.rows.clear();
|
||||||
@ -270,6 +272,7 @@ public class DataExtensionChange implements Change {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void save(Writer writer, Properties options) throws IOException {
|
public void save(Writer writer, Properties options) throws IOException {
|
||||||
writer.write("baseColumnName="); writer.write(_baseColumnName); writer.write('\n');
|
writer.write("baseColumnName="); writer.write(_baseColumnName); writer.write('\n');
|
||||||
writer.write("columnInsertIndex="); writer.write(Integer.toString(_columnInsertIndex)); writer.write('\n');
|
writer.write("columnInsertIndex="); writer.write(Integer.toString(_columnInsertIndex)); writer.write('\n');
|
||||||
|
@ -80,6 +80,7 @@ public class DataExtensionReconConfig extends StrictReconConfig {
|
|||||||
throw new RuntimeException(WARN);
|
throw new RuntimeException(WARN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options) throws JSONException {
|
public void write(JSONWriter writer, Properties options) throws JSONException {
|
||||||
writer.object();
|
writer.object();
|
||||||
writer.key("mode"); writer.value("extend");
|
writer.key("mode"); writer.value("extend");
|
||||||
|
@ -69,6 +69,7 @@ public class GuidBasedReconConfig extends StrictReconConfig {
|
|||||||
static protected class GuidBasedReconJob extends ReconJob {
|
static protected class GuidBasedReconJob extends ReconJob {
|
||||||
String guid;
|
String guid;
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getKey() {
|
public int getKey() {
|
||||||
return guid.hashCode();
|
return guid.hashCode();
|
||||||
}
|
}
|
||||||
@ -102,6 +103,7 @@ public class GuidBasedReconConfig extends StrictReconConfig {
|
|||||||
return "Reconcile cells in column " + columnName + " as Freebase IDs";
|
return "Reconcile cells in column " + columnName + " as Freebase IDs";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@ public class IdBasedReconConfig extends StrictReconConfig {
|
|||||||
static protected class IdBasedReconJob extends ReconJob {
|
static protected class IdBasedReconJob extends ReconJob {
|
||||||
String id;
|
String id;
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getKey() {
|
public int getKey() {
|
||||||
return id.hashCode();
|
return id.hashCode();
|
||||||
}
|
}
|
||||||
@ -106,6 +107,7 @@ public class IdBasedReconConfig extends StrictReconConfig {
|
|||||||
return "Reconcile cells in column " + columnName + " as Freebase IDs";
|
return "Reconcile cells in column " + columnName + " as Freebase IDs";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ public class KeyBasedReconConfig extends StrictReconConfig {
|
|||||||
static protected class KeyBasedReconJob extends ReconJob {
|
static protected class KeyBasedReconJob extends ReconJob {
|
||||||
String key;
|
String key;
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getKey() {
|
public int getKey() {
|
||||||
return key.hashCode();
|
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;
|
return "Reconcile cells in column " + columnName + " to topics with keys in namespace " + namespace.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -50,14 +50,17 @@ public class FreebaseProvider extends Provider {
|
|||||||
super(host);
|
super(host);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getRequestTokenServiceURL() {
|
public String getRequestTokenServiceURL() {
|
||||||
return "https://" + host + "/api/oauth/request_token";
|
return "https://" + host + "/api/oauth/request_token";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getAccessTokenServiceURL() {
|
public String getAccessTokenServiceURL() {
|
||||||
return "https://" + host + "/api/oauth/access_token";
|
return "https://" + host + "/api/oauth/access_token";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getUserAuthorizationURL() {
|
public String getUserAuthorizationURL() {
|
||||||
return "https://" + host + "/signin/app";
|
return "https://" + host + "/signin/app";
|
||||||
}
|
}
|
||||||
|
@ -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
|
* 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.
|
* could be said if we used an NTP client.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected String generateTimestamp() {
|
protected String generateTimestamp() {
|
||||||
|
|
||||||
long time = -1;
|
long time = -1;
|
||||||
|
@ -96,6 +96,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
|
|||||||
_columnInsertIndex = columnInsertIndex;
|
_columnInsertIndex = columnInsertIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
@ -109,6 +110,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
|
|||||||
writer.endObject();
|
writer.endObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getBriefDescription(Project project) {
|
protected String getBriefDescription(Project project) {
|
||||||
return "Extend data at index " + _columnInsertIndex +
|
return "Extend data at index " + _columnInsertIndex +
|
||||||
" based on column " + _baseColumnName;
|
" based on column " + _baseColumnName;
|
||||||
@ -120,6 +122,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
|
|||||||
" by filling " + cellsAtRows.size();
|
" by filling " + cellsAtRows.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Process createProcess(Project project, Properties options) throws Exception {
|
public Process createProcess(Project project, Properties options) throws Exception {
|
||||||
return new ExtendDataProcess(
|
return new ExtendDataProcess(
|
||||||
project,
|
project,
|
||||||
@ -148,6 +151,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
|
|||||||
_job = new FreebaseDataExtensionJob(_extension);
|
_job = new FreebaseDataExtensionJob(_extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
@ -160,6 +164,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
|
|||||||
writer.endObject();
|
writer.endObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Runnable getRunnable() {
|
protected Runnable getRunnable() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -194,6 +199,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(Project project, int rowIndex, Row row) {
|
public boolean visit(Project project, int rowIndex, Row row) {
|
||||||
Cell cell = row.getCell(_cellIndex);
|
Cell cell = row.getCell(_cellIndex);
|
||||||
if (cell != null && cell.recon != null && cell.recon.match != null) {
|
if (cell != null && cell.recon != null && cell.recon.match != null) {
|
||||||
@ -246,6 +252,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
|
|||||||
return end;
|
return end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
List<Integer> rowIndices = new ArrayList<Integer>();
|
List<Integer> rowIndices = new ArrayList<Integer>();
|
||||||
List<DataExtension> dataExtensions = new ArrayList<DataExtension>();
|
List<DataExtension> dataExtensions = new ArrayList<DataExtension>();
|
||||||
|
@ -64,6 +64,7 @@ public class ImportQADataOperation extends AbstractOperation {
|
|||||||
public ImportQADataOperation() {
|
public ImportQADataOperation() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ public class SaveProtographOperation extends AbstractOperation {
|
|||||||
_protograph = protograph;
|
_protograph = protograph;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
@ -74,6 +75,7 @@ public class SaveProtographOperation extends AbstractOperation {
|
|||||||
writer.endObject();
|
writer.endObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getBriefDescription(Project project) {
|
protected String getBriefDescription(Project project) {
|
||||||
return "Save schema alignment skeleton";
|
return "Save schema alignment skeleton";
|
||||||
}
|
}
|
||||||
@ -93,6 +95,7 @@ public class SaveProtographOperation extends AbstractOperation {
|
|||||||
_newProtograph = protograph;
|
_newProtograph = protograph;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void apply(Project project) {
|
public void apply(Project project) {
|
||||||
synchronized (project) {
|
synchronized (project) {
|
||||||
_oldProtograph = (Protograph) project.overlayModels.get("freebaseProtograph");
|
_oldProtograph = (Protograph) project.overlayModels.get("freebaseProtograph");
|
||||||
@ -101,6 +104,7 @@ public class SaveProtographOperation extends AbstractOperation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void revert(Project project) {
|
public void revert(Project project) {
|
||||||
synchronized (project) {
|
synchronized (project) {
|
||||||
if (_oldProtograph == null) {
|
if (_oldProtograph == null) {
|
||||||
@ -111,6 +115,7 @@ public class SaveProtographOperation extends AbstractOperation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void save(Writer writer, Properties options) throws IOException {
|
public void save(Writer writer, Properties options) throws IOException {
|
||||||
writer.write("newProtograph="); writeProtograph(_newProtograph, writer); writer.write('\n');
|
writer.write("newProtograph="); writeProtograph(_newProtograph, writer); writer.write('\n');
|
||||||
writer.write("oldProtograph="); writeProtograph(_oldProtograph, writer); writer.write('\n');
|
writer.write("oldProtograph="); writeProtograph(_oldProtograph, writer); writer.write('\n');
|
||||||
|
@ -50,6 +50,7 @@ public class AnonymousNode implements Node, NodeWithLinks {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
@ -66,14 +67,17 @@ public class AnonymousNode implements Node, NodeWithLinks {
|
|||||||
writer.endObject();
|
writer.endObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addLink(Link link) {
|
public void addLink(Link link) {
|
||||||
links.add(link);
|
links.add(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Link getLink(int index) {
|
public Link getLink(int index) {
|
||||||
return links.get(index);
|
return links.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getLinkCount() {
|
public int getLinkCount() {
|
||||||
return links.size();
|
return links.size();
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ public class CellKeyNode extends CellNode {
|
|||||||
this.namespace = namespace;
|
this.namespace = namespace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ public class CellTopicNode extends CellNode implements NodeWithLinks {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
@ -77,14 +78,17 @@ public class CellTopicNode extends CellNode implements NodeWithLinks {
|
|||||||
writer.endObject();
|
writer.endObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addLink(Link link) {
|
public void addLink(Link link) {
|
||||||
links.add(link);
|
links.add(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Link getLink(int index) {
|
public Link getLink(int index) {
|
||||||
return links.get(index);
|
return links.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getLinkCount() {
|
public int getLinkCount() {
|
||||||
return links.size();
|
return links.size();
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,7 @@ public class CellValueNode extends CellNode {
|
|||||||
this.lang = lang;
|
this.lang = lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ public class FreebaseTopicNode implements Node, NodeWithLinks {
|
|||||||
this.topic = topic;
|
this.topic = topic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
@ -67,14 +68,17 @@ public class FreebaseTopicNode implements Node, NodeWithLinks {
|
|||||||
writer.endObject();
|
writer.endObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addLink(Link link) {
|
public void addLink(Link link) {
|
||||||
links.add(link);
|
links.add(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Link getLink(int index) {
|
public Link getLink(int index) {
|
||||||
return links.get(index);
|
return links.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getLinkCount() {
|
public int getLinkCount() {
|
||||||
return links.size();
|
return links.size();
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ public class Link implements Jsonizable {
|
|||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -186,6 +186,7 @@ public class Protograph implements OverlayModel {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options) throws JSONException {
|
public void write(JSONWriter writer, Properties options) throws JSONException {
|
||||||
writer.object();
|
writer.object();
|
||||||
writer.key("rootNodes"); writer.array();
|
writer.key("rootNodes"); writer.array();
|
||||||
|
@ -49,6 +49,7 @@ public class ValueNode implements Node {
|
|||||||
this.lang = lang;
|
this.lang = lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -102,6 +102,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
|
|
||||||
protected JSONObject obj;
|
protected JSONObject obj;
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getJSON() {
|
public Object getJSON() {
|
||||||
return getJSONObject();
|
return getJSONObject();
|
||||||
}
|
}
|
||||||
@ -122,6 +123,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
this.node = node;
|
this.node = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public JSONObject getJSONObject() {
|
public JSONObject getJSONObject() {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
obj = new JSONObject();
|
obj = new JSONObject();
|
||||||
@ -182,6 +184,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
this.cell = cell;
|
this.cell = cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getJSON() {
|
public Object getJSON() {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
obj = new JSONObject();
|
obj = new JSONObject();
|
||||||
@ -212,6 +215,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
this.cell = cell;
|
this.cell = cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getJSON() {
|
public Object getJSON() {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
obj = new JSONObject();
|
obj = new JSONObject();
|
||||||
@ -260,6 +264,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
this.node = node;
|
this.node = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getJSON() {
|
public Object getJSON() {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
obj = new JSONObject();
|
obj = new JSONObject();
|
||||||
@ -278,6 +283,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public TransposedNode transposeAnonymousNode(
|
public TransposedNode transposeAnonymousNode(
|
||||||
TransposedNode parentNode,
|
TransposedNode parentNode,
|
||||||
Link link,
|
Link link,
|
||||||
@ -290,6 +296,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TransposedNode transposeCellNode(
|
public TransposedNode transposeCellNode(
|
||||||
TransposedNode parentNode,
|
TransposedNode parentNode,
|
||||||
Link link,
|
Link link,
|
||||||
@ -313,6 +320,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
return tnode;
|
return tnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TransposedNode transposeTopicNode(
|
public TransposedNode transposeTopicNode(
|
||||||
TransposedNode parentNode,
|
TransposedNode parentNode,
|
||||||
Link link,
|
Link link,
|
||||||
@ -325,6 +333,7 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
return tnode;
|
return tnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TransposedNode transposeValueNode(
|
public TransposedNode transposeValueNode(
|
||||||
TransposedNode parentNode,
|
TransposedNode parentNode,
|
||||||
Link link,
|
Link link,
|
||||||
|
@ -349,6 +349,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
|
|
||||||
//protected AnonymousTransposedNode(AnonymousNode node) { }
|
//protected AnonymousTransposedNode(AnonymousNode node) { }
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
||||||
if (children.size() == 0 || subject == null) {
|
if (children.size() == 0 || subject == null) {
|
||||||
return null;
|
return null;
|
||||||
@ -431,6 +432,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
this.cell = cell;
|
this.cell = cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
||||||
String id = null;
|
String id = null;
|
||||||
if (cell.recon != null && cell.recon.judgment != Recon.Judgment.None) {
|
if (cell.recon != null && cell.recon.judgment != Recon.Judgment.None) {
|
||||||
@ -505,6 +507,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
this.cell = cell;
|
this.cell = cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
||||||
Object value = cell.value;
|
Object value = cell.value;
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
@ -541,6 +544,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
this.cell = cell;
|
this.cell = cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
||||||
writeLine(subject, "key", node.namespace.id + "/" + cell.value, project,
|
writeLine(subject, "key", node.namespace.id + "/" + cell.value, project,
|
||||||
subjectRowIndex, subjectCellIndex, subjectCell,
|
subjectRowIndex, subjectCellIndex, subjectCell,
|
||||||
@ -557,6 +561,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
this.node = node;
|
this.node = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
||||||
writeLine(subject, predicate, node.topic.id, project,
|
writeLine(subject, predicate, node.topic.id, project,
|
||||||
subjectRowIndex, subjectCellIndex, subjectCell,
|
subjectRowIndex, subjectCellIndex, subjectCell,
|
||||||
@ -575,6 +580,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
this.node = node;
|
this.node = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
public Object internalWrite(String subject, String predicate, Project project, int subjectRowIndex, int subjectCellIndex, Cell subjectCell) {
|
||||||
Object value = node.value;
|
Object value = node.value;
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
@ -597,6 +603,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TransposedNode transposeAnonymousNode(
|
public TransposedNode transposeAnonymousNode(
|
||||||
TransposedNode parentNode,
|
TransposedNode parentNode,
|
||||||
Link link,
|
Link link,
|
||||||
@ -620,6 +627,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
return tnode;
|
return tnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TransposedNode transposeCellNode(
|
public TransposedNode transposeCellNode(
|
||||||
TransposedNode parentNode,
|
TransposedNode parentNode,
|
||||||
Link link,
|
Link link,
|
||||||
@ -662,6 +670,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
return tnode;
|
return tnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TransposedNode transposeTopicNode(
|
public TransposedNode transposeTopicNode(
|
||||||
TransposedNode parentNode,
|
TransposedNode parentNode,
|
||||||
Link link,
|
Link link,
|
||||||
@ -686,6 +695,7 @@ public class TripleLoaderTransposedNodeFactory implements TransposedNodeFactory
|
|||||||
return tnode;
|
return tnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TransposedNode transposeValueNode(
|
public TransposedNode transposeValueNode(
|
||||||
TransposedNode parentNode,
|
TransposedNode parentNode,
|
||||||
Link link,
|
Link link,
|
||||||
|
@ -15,6 +15,7 @@ import com.google.refine.commands.Command;
|
|||||||
*/
|
*/
|
||||||
public class AuthorizeCommand extends Command {
|
public class AuthorizeCommand extends Command {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response)
|
public void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException {
|
throws ServletException, IOException {
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import com.google.refine.commands.Command;
|
|||||||
*/
|
*/
|
||||||
public class AuthorizeCommand2 extends Command {
|
public class AuthorizeCommand2 extends Command {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response)
|
public void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException {
|
throws ServletException, IOException {
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import com.google.refine.commands.Command;
|
|||||||
|
|
||||||
public class DeAuthorizeCommand extends Command {
|
public class DeAuthorizeCommand extends Command {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response)
|
public void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws ServletException, IOException {
|
throws ServletException, IOException {
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ public class JythonEvaluable implements Evaluable {
|
|||||||
static public LanguageSpecificParser createParser() {
|
static public LanguageSpecificParser createParser() {
|
||||||
return new LanguageSpecificParser() {
|
return new LanguageSpecificParser() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Evaluable parse(String s) throws ParsingException {
|
public Evaluable parse(String s) throws ParsingException {
|
||||||
return new JythonEvaluable(s);
|
return new JythonEvaluable(s);
|
||||||
}
|
}
|
||||||
@ -108,6 +109,7 @@ public class JythonEvaluable implements Evaluable {
|
|||||||
_engine.exec(sb.toString());
|
_engine.exec(sb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object evaluate(Properties bindings) {
|
public Object evaluate(Properties bindings) {
|
||||||
try {
|
try {
|
||||||
// call the temporary PyFunction directly
|
// call the temporary PyFunction directly
|
||||||
|
@ -52,6 +52,7 @@ public class JythonHasFieldsWrapper extends PyObject {
|
|||||||
_bindings = bindings;
|
_bindings = bindings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public PyObject __finditem__(PyObject key) {
|
public PyObject __finditem__(PyObject key) {
|
||||||
String k = (String) key.__tojava__(String.class);
|
String k = (String) key.__tojava__(String.class);
|
||||||
Object v = _obj.getField(k, _bindings);
|
Object v = _obj.getField(k, _bindings);
|
||||||
|
@ -44,6 +44,7 @@ public class JythonObjectWrapper extends PyObject {
|
|||||||
_obj = obj;
|
_obj = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return _obj.getClass().getSimpleName();
|
return _obj.getClass().getSimpleName();
|
||||||
}
|
}
|
||||||
|
@ -268,6 +268,7 @@ public abstract class ProjectManager {
|
|||||||
|
|
||||||
if (records.size() > 0) {
|
if (records.size() > 0) {
|
||||||
Collections.sort(records, new Comparator<SaveRecord>() {
|
Collections.sort(records, new Comparator<SaveRecord>() {
|
||||||
|
@Override
|
||||||
public int compare(SaveRecord o1, SaveRecord o2) {
|
public int compare(SaveRecord o1, SaveRecord o2) {
|
||||||
if (o1.overdue < o2.overdue) {
|
if (o1.overdue < o2.overdue) {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -76,6 +76,7 @@ public class ProjectMetadata implements Jsonizable {
|
|||||||
preparePreferenceStore(_preferenceStore);
|
preparePreferenceStore(_preferenceStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ public class RefineServlet extends Butterfly {
|
|||||||
static final protected long s_autoSavePeriod = 1000 * 60 * 5; // 5 minutes
|
static final protected long s_autoSavePeriod = 1000 * 60 * 5; // 5 minutes
|
||||||
|
|
||||||
static protected class AutoSaveTimerTask extends TimerTask {
|
static protected class AutoSaveTimerTask extends TimerTask {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
ProjectManager.singleton.save(false); // quick, potentially incomplete save
|
ProjectManager.singleton.save(false); // quick, potentially incomplete save
|
||||||
|
@ -56,6 +56,7 @@ public class DecoratedValue implements Jsonizable {
|
|||||||
this.label = label;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
writer.object();
|
writer.object();
|
||||||
|
@ -231,6 +231,7 @@ public class Engine implements Jsonizable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ public class kNNClusterer extends Clusterer {
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(Project project, int rowIndex, Row row) {
|
public boolean visit(Project project, int rowIndex, Row row) {
|
||||||
Cell cell = row.getCell(_colindex);
|
Cell cell = row.getCell(_colindex);
|
||||||
if (cell != null && cell.value != null) {
|
if (cell != null && cell.value != null) {
|
||||||
@ -174,6 +175,7 @@ public class kNNClusterer extends Clusterer {
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(Project project, int rowIndex, Row row) {
|
public boolean visit(Project project, int rowIndex, Row row) {
|
||||||
Cell cell = row.getCell(_colindex);
|
Cell cell = row.getCell(_colindex);
|
||||||
if (cell != null && cell.value != null) {
|
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 {
|
public void initializeFromJSON(Project project, JSONObject o) throws Exception {
|
||||||
super.initializeFromJSON(project, o);
|
super.initializeFromJSON(project, o);
|
||||||
_distance = _distances.get(o.getString("function").toLowerCase());
|
_distance = _distances.get(o.getString("function").toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void computeClusters(Engine engine) {
|
public void computeClusters(Engine engine) {
|
||||||
//VPTreeClusteringRowVisitor visitor = new VPTreeClusteringRowVisitor(_distance,_config);
|
//VPTreeClusteringRowVisitor visitor = new VPTreeClusteringRowVisitor(_distance,_config);
|
||||||
BlockingClusteringRowVisitor visitor = new BlockingClusteringRowVisitor(_distance,_config);
|
BlockingClusteringRowVisitor visitor = new BlockingClusteringRowVisitor(_distance,_config);
|
||||||
@ -206,11 +210,13 @@ public class kNNClusterer extends Clusterer {
|
|||||||
|
|
||||||
public static class ValuesComparator implements Comparator<Entry<Serializable,Integer>>, Serializable {
|
public static class ValuesComparator implements Comparator<Entry<Serializable,Integer>>, Serializable {
|
||||||
private static final long serialVersionUID = 204469656070583155L;
|
private static final long serialVersionUID = 204469656070583155L;
|
||||||
|
@Override
|
||||||
public int compare(Entry<Serializable,Integer> o1, Entry<Serializable,Integer> o2) {
|
public int compare(Entry<Serializable,Integer> o1, Entry<Serializable,Integer> o2) {
|
||||||
return o2.getValue() - o1.getValue();
|
return o2.getValue() - o1.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options) throws JSONException {
|
public void write(JSONWriter writer, Properties options) throws JSONException {
|
||||||
writer.array();
|
writer.array();
|
||||||
for (Set<Serializable> m : _clusters) {
|
for (Set<Serializable> m : _clusters) {
|
||||||
|
@ -136,6 +136,7 @@ public class EditOneCellCommand extends Command {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
||||||
Cell cell = _project.rows.get(rowIndex).getCell(cellIndex);
|
Cell cell = _project.rows.get(rowIndex).getCell(cellIndex);
|
||||||
Column column = _project.columnModel.getColumnByCellIndex(cellIndex);
|
Column column = _project.columnModel.getColumnByCellIndex(cellIndex);
|
||||||
|
@ -243,6 +243,7 @@ public class GuessTypesOfColumnCommand extends Command {
|
|||||||
|
|
||||||
List<TypeGroup> types = new ArrayList<TypeGroup>(map.values());
|
List<TypeGroup> types = new ArrayList<TypeGroup>(map.values());
|
||||||
Collections.sort(types, new Comparator<TypeGroup>() {
|
Collections.sort(types, new Comparator<TypeGroup>() {
|
||||||
|
@Override
|
||||||
public int compare(TypeGroup o1, TypeGroup o2) {
|
public int compare(TypeGroup o1, TypeGroup o2) {
|
||||||
int c = Math.min(s_sampleSize, o2.count) - Math.min(s_sampleSize, o1.count);
|
int c = Math.min(s_sampleSize, o2.count) - Math.min(s_sampleSize, o1.count);
|
||||||
if (c != 0) {
|
if (c != 0) {
|
||||||
|
@ -118,6 +118,7 @@ public class ReconClearOneCellCommand extends Command {
|
|||||||
this.cellIndex = cellIndex;
|
this.cellIndex = cellIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
||||||
Cell cell = _project.rows.get(rowIndex).getCell(cellIndex);
|
Cell cell = _project.rows.get(rowIndex).getCell(cellIndex);
|
||||||
if (cell == null || !ExpressionUtils.isNonBlankData(cell.value)) {
|
if (cell == null || !ExpressionUtils.isNonBlankData(cell.value)) {
|
||||||
|
@ -154,6 +154,7 @@ public class ReconJudgeOneCellCommand extends Command {
|
|||||||
this.schemaSpace = schemaSpace;
|
this.schemaSpace = schemaSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
||||||
Cell cell = _project.rows.get(rowIndex).getCell(cellIndex);
|
Cell cell = _project.rows.get(rowIndex).getCell(cellIndex);
|
||||||
if (cell == null || !ExpressionUtils.isNonBlankData(cell.value)) {
|
if (cell == null || !ExpressionUtils.isNonBlankData(cell.value)) {
|
||||||
|
@ -114,6 +114,7 @@ public class AnnotateOneRowCommand extends Command {
|
|||||||
this.starred = starred;
|
this.starred = starred;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
||||||
return new HistoryEntry(
|
return new HistoryEntry(
|
||||||
historyEntryID,
|
historyEntryID,
|
||||||
@ -140,6 +141,7 @@ public class AnnotateOneRowCommand extends Command {
|
|||||||
this.flagged = flagged;
|
this.flagged = flagged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception {
|
||||||
return new HistoryEntry(
|
return new HistoryEntry(
|
||||||
historyEntryID,
|
historyEntryID,
|
||||||
|
@ -208,6 +208,7 @@ public class GetRowsCommand extends Command {
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(Project project, int rowIndex, Row row) {
|
public boolean visit(Project project, int rowIndex, Row row) {
|
||||||
if (total >= start && total < start + limit) {
|
if (total >= start && total < start + limit) {
|
||||||
internalVisit(project, rowIndex, row);
|
internalVisit(project, rowIndex, row);
|
||||||
|
@ -84,6 +84,7 @@ public class CsvExporter implements WriterExporter{
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(Project project, int rowIndex, Row row) {
|
public boolean visit(Project project, int rowIndex, Row row) {
|
||||||
int size = project.columnModel.columns.size();
|
int size = project.columnModel.columns.size();
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ public class HtmlTableExporter implements WriterExporter {
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(Project project, int rowIndex, Row row) {
|
public boolean visit(Project project, int rowIndex, Row row) {
|
||||||
try {
|
try {
|
||||||
writer.write("<tr>");
|
writer.write("<tr>");
|
||||||
|
@ -48,6 +48,7 @@ import com.google.refine.model.Project;
|
|||||||
|
|
||||||
public class Cross implements Function {
|
public class Cross implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 3) {
|
if (args.length == 3) {
|
||||||
// from project is implied
|
// 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");
|
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)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ import com.google.refine.model.Project;
|
|||||||
|
|
||||||
public class FacetCount implements Function {
|
public class FacetCount implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 3 && args[1] instanceof String && args[2] instanceof String) {
|
if (args.length == 3 && args[1] instanceof String && args[2] instanceof String) {
|
||||||
Object choiceValue = args[0]; // choice value to look up
|
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");
|
" expects a choice value, an expression as a string, and a column name");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Get implements Function {
|
public class Get implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length > 1 && args.length <= 3) {
|
if (args.length > 1 && args.length <= 3) {
|
||||||
Object v = args[0];
|
Object v = args[0];
|
||||||
@ -164,6 +165,7 @@ public class Get implements Function {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class HasField implements Function {
|
public class HasField implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length > 1 && args.length <= 2) {
|
if (args.length > 1 && args.length <= 2) {
|
||||||
Object v = args[0];
|
Object v = args[0];
|
||||||
@ -65,6 +66,7 @@ public class HasField implements Function {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Jsonize implements Function {
|
public class Jsonize implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length >= 1) {
|
if (args.length >= 1) {
|
||||||
try {
|
try {
|
||||||
@ -77,6 +78,7 @@ public class Jsonize implements Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Length implements Function {
|
public class Length implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
Object v = args[0];
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array or a string");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Slice implements Function {
|
public class Slice implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length > 1 && args.length <= 3) {
|
if (args.length > 1 && args.length <= 3) {
|
||||||
Object v = args[0];
|
Object v = args[0];
|
||||||
@ -128,6 +129,7 @@ public class Slice implements Function {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class ToDate implements Function {
|
public class ToDate implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
// missing value, can this happen?
|
// missing value, can this happen?
|
||||||
@ -98,6 +99,7 @@ public class ToDate implements Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class ToNumber implements Function {
|
public class ToNumber implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null) {
|
if (args.length == 1 && args[0] != null) {
|
||||||
if (args[0] instanceof Number) {
|
if (args[0] instanceof Number) {
|
||||||
@ -59,6 +60,7 @@ public class ToNumber implements Function {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class ToString implements Function {
|
public class ToString implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length >= 1) {
|
if (args.length >= 1) {
|
||||||
Object o1 = args[0];
|
Object o1 = args[0];
|
||||||
@ -71,6 +72,7 @@ public class ToString implements Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Type implements Function {
|
public class Type implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
Object v = args[0];
|
Object v = args[0];
|
||||||
@ -71,6 +72,7 @@ public class Type implements Function {
|
|||||||
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects one argument");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects one argument");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -42,10 +42,12 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class ArgsToArray implements Function {
|
public class ArgsToArray implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Join implements Function {
|
public class Join implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
Object v = args[0];
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array and a string");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ import com.google.refine.util.JSONUtilities;
|
|||||||
|
|
||||||
public class Reverse implements Function {
|
public class Reverse implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
Object v = args[0];
|
Object v = args[0];
|
||||||
@ -86,6 +87,7 @@ public class Reverse implements Function {
|
|||||||
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ import com.google.refine.util.JSONUtilities;
|
|||||||
|
|
||||||
public class Sort implements Function {
|
public class Sort implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
@ -84,6 +85,7 @@ public class Sort implements Function {
|
|||||||
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ import com.google.refine.util.JSONUtilities;
|
|||||||
|
|
||||||
public class Uniques implements Function {
|
public class Uniques implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
Object v = args[0];
|
Object v = args[0];
|
||||||
@ -84,6 +85,7 @@ public class Uniques implements Function {
|
|||||||
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects an array");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class And implements Function {
|
public class And implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
for (Object o : args) {
|
for (Object o : args) {
|
||||||
if (!Not.objectToBoolean(o)) {
|
if (!Not.objectToBoolean(o)) {
|
||||||
@ -51,6 +52,7 @@ public class And implements Function {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Not implements Function {
|
public class Not implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
return !objectToBoolean(args[0]);
|
return !objectToBoolean(args[0]);
|
||||||
@ -56,6 +57,7 @@ public class Not implements Function {
|
|||||||
(o instanceof Boolean) ? ((Boolean) o).booleanValue() : Boolean.parseBoolean(o.toString()));
|
(o instanceof Boolean) ? ((Boolean) o).booleanValue() : Boolean.parseBoolean(o.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Or implements Function {
|
public class Or implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
for (Object o : args) {
|
for (Object o : args) {
|
||||||
if (Not.objectToBoolean(o)) {
|
if (Not.objectToBoolean(o)) {
|
||||||
@ -51,6 +52,7 @@ public class Or implements Function {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class DatePart implements Function {
|
public class DatePart implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2 &&
|
if (args.length == 2 &&
|
||||||
args[0] != null && (args[0] instanceof Calendar || args[0] instanceof Date) &&
|
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 {
|
public void write(JSONWriter writer, Properties options) throws JSONException {
|
||||||
writer.object();
|
writer.object();
|
||||||
writer.key("description"); writer.value("Returns part of a date");
|
writer.key("description"); writer.value("Returns part of a date");
|
||||||
|
@ -46,6 +46,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Inc implements Function {
|
public class Inc implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 3 &&
|
if (args.length == 3 &&
|
||||||
args[0] != null && (args[0] instanceof Calendar || args[0] instanceof Date) &&
|
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 {
|
public void write(JSONWriter writer, Properties options) throws JSONException {
|
||||||
writer.object();
|
writer.object();
|
||||||
writer.key("description"); writer.value("Returns a date changed by the given amount in the given unit of time");
|
writer.key("description"); writer.value("Returns a date changed by the given amount in the given unit of time");
|
||||||
|
@ -43,6 +43,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Now implements Function {
|
public class Now implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
return Calendar.getInstance();
|
return Calendar.getInstance();
|
||||||
@ -50,6 +51,7 @@ public class Now implements Function {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class HtmlAttr implements Function {
|
public class HtmlAttr implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length >= 2) {
|
if (args.length >= 2) {
|
||||||
Object o1 = args[0];
|
Object o1 = args[0];
|
||||||
@ -62,6 +63,7 @@ public class HtmlAttr implements Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class HtmlText implements Function {
|
public class HtmlText implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length >= 1) {
|
if (args.length >= 1) {
|
||||||
Object o1 = args[0];
|
Object o1 = args[0];
|
||||||
@ -60,6 +61,7 @@ public class HtmlText implements Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class InnerHtml implements Function {
|
public class InnerHtml implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length >= 1) {
|
if (args.length >= 1) {
|
||||||
Object o1 = args[0];
|
Object o1 = args[0];
|
||||||
@ -60,6 +61,7 @@ public class InnerHtml implements Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class ParseHtml implements Function {
|
public class ParseHtml implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length >= 1) {
|
if (args.length >= 1) {
|
||||||
Object o1 = args[0];
|
Object o1 = args[0];
|
||||||
@ -54,6 +55,7 @@ public class ParseHtml implements Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class SelectHtml implements Function {
|
public class SelectHtml implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length >= 2) {
|
if (args.length >= 2) {
|
||||||
Object o1 = args[0];
|
Object o1 = args[0];
|
||||||
@ -62,6 +63,7 @@ public class SelectHtml implements Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class ACos implements Function {
|
public class ACos implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Math.acos(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class ASin implements Function {
|
public class ASin implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Math.asin(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class ATan implements Function {
|
public class ATan implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Math.atan(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class ATan2 implements Function {
|
public class ATan2 implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2 && args[0] != null && args[0] instanceof Number
|
if (args.length == 2 && args[0] != null && args[0] instanceof Number
|
||||||
&& args[1] != null && args[1] 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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Abs implements Function {
|
public class Abs implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Math.abs(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Ceil implements Function {
|
public class Ceil implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return (long) Math.ceil(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Combin implements Function {
|
public class Combin implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if(args.length != 2)
|
if(args.length != 2)
|
||||||
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects two numbers");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects two numbers");
|
||||||
@ -66,6 +67,7 @@ public class Combin implements Function {
|
|||||||
return nFact / (rFact * nminusrFact);
|
return nFact / (rFact * nminusrFact);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Cos implements Function {
|
public class Cos implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Math.cos(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Cosh implements Function {
|
public class Cosh implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return StrictMath.cosh(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Degrees implements Function {
|
public class Degrees implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Math.toDegrees(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Even implements Function {
|
public class Even implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Even.RoundUpToEven(((Number) args[0]).doubleValue());
|
return Even.RoundUpToEven(((Number) args[0]).doubleValue());
|
||||||
@ -56,6 +57,7 @@ public class Even implements Function {
|
|||||||
return ((temp % 2) == 0) ? temp : temp+1;
|
return ((temp % 2) == 0) ? temp : temp+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Exp implements Function {
|
public class Exp implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] instanceof Number) {
|
||||||
return Math.exp(((Number) args[0]).doubleValue());
|
return Math.exp(((Number) args[0]).doubleValue());
|
||||||
@ -49,6 +50,7 @@ public class Exp implements Function {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Fact implements Function {
|
public class Fact implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return FactN.factorial(((Number) args[0]).intValue(), 1);
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class FactN implements Function {
|
public class FactN implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length != 2)
|
if (args.length != 2)
|
||||||
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects two numbers");
|
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);
|
return i * FactN.factorial(i - step, step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Floor implements Function {
|
public class Floor implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return (long) Math.floor(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class GreatestCommonDenominator implements Function {
|
public class GreatestCommonDenominator implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2 && args[0] != null && args[0] instanceof Number
|
if (args.length == 2 && args[0] != null && args[0] instanceof Number
|
||||||
&& args[1] != null && args[1] 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);
|
return b == 0 ? a : GCD(b, a % b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class LeastCommonMultiple implements Function {
|
public class LeastCommonMultiple implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2
|
if (args.length == 2
|
||||||
&& args[0] != null && args[0] instanceof Number
|
&& args[0] != null && args[0] instanceof Number
|
||||||
@ -67,6 +68,7 @@ public class LeastCommonMultiple implements Function {
|
|||||||
return largerValue * smallerValue;
|
return largerValue * smallerValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Ln implements Function {
|
public class Ln implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Math.log(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Log implements Function {
|
public class Log implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Math.log10(((Number) args[0]).doubleValue());
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects a number");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Max implements Function {
|
public class Max implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2 &&
|
if (args.length == 2 &&
|
||||||
args[0] != null && args[0] instanceof Number &&
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 numbers");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Min implements Function {
|
public class Min implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2 &&
|
if (args.length == 2 &&
|
||||||
args[0] != null && args[0] instanceof Number &&
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 numbers");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Mod implements Function {
|
public class Mod implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2 &&
|
if (args.length == 2 &&
|
||||||
args[0] != null && args[0] instanceof Number &&
|
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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 2 numbers");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Multinomial implements Function {
|
public class Multinomial implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length < 1)
|
if (args.length < 1)
|
||||||
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects one or more numbers");
|
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;
|
return FactN.factorial(sum, 1) / product;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Odd implements Function {
|
public class Odd implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
if (args.length == 1 && args[0] != null && args[0] instanceof Number) {
|
||||||
return Odd.RoundUpToOdd(((Number) args[0]).doubleValue());
|
return Odd.RoundUpToOdd(((Number) args[0]).doubleValue());
|
||||||
@ -56,6 +57,7 @@ public class Odd implements Function {
|
|||||||
return ((temp % 2) == 0) ? temp + 1 : temp;
|
return ((temp % 2) == 0) ? temp + 1 : temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Pow implements Function {
|
public class Pow implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2 && args[0] instanceof Number && args[1] instanceof Number) {
|
if (args.length == 2 && args[0] instanceof Number && args[1] instanceof Number) {
|
||||||
return Math.pow(
|
return Math.pow(
|
||||||
@ -52,6 +53,7 @@ public class Pow implements Function {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ import com.google.refine.grel.Function;
|
|||||||
|
|
||||||
public class Quotient implements Function {
|
public class Quotient implements Function {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object call(Properties bindings, Object[] args) {
|
public Object call(Properties bindings, Object[] args) {
|
||||||
if (args.length == 2 && args[0] != null && args[0] instanceof Number
|
if (args.length == 2 && args[0] != null && args[0] instanceof Number
|
||||||
&& args[1] != null && args[1] 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");
|
return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects two numbers");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JSONWriter writer, Properties options)
|
public void write(JSONWriter writer, Properties options)
|
||||||
throws JSONException {
|
throws JSONException {
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user