diff options
author | Arne H Juul <arnej@yahoo-inc.com> | 2016-08-26 10:56:55 +0200 |
---|---|---|
committer | Arne H Juul <arnej@yahoo-inc.com> | 2016-08-26 10:58:10 +0200 |
commit | b182f660e3e36cd530fe5cb4bb459c9f04ffdc68 (patch) | |
tree | b91509defc239bac76f0a98764315953d785b1fa /config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java | |
parent | db33333e69efdba1d90e6e3e3585a16db76341f2 (diff) |
add RankingConstant class
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java new file mode 100644 index 00000000000..df0eda8e96a --- /dev/null +++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java @@ -0,0 +1,41 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.searchdefinition; + +import com.yahoo.tensor.TensorType; + +/** + * Represents a global ranking constant (declared in a .sd file) + * + * @author arnej + */ +public class RankingConstant { + /** The search definition-unique name of this constant */ + final String name; + + private TensorType tensorType = null; + private String fileName = ""; + private String fileRef = ""; + + public RankingConstant(String name) { + this.name = name; + } + + public void setFileName(String fileName) { this.fileName = fileName; } + public void setFileReference(String fileRef) { this.fileRef = fileRef; } + public void setType(TensorType tensorType) { this.tensorType = tensorType; } + + public String getName() { return name; } + public String getFileName() { return fileName; } + public String getFileReference() { return fileRef; } + public String getType() { return tensorType.toString(); } + + public String toString() { + StringBuilder b = new StringBuilder(); + b.append("constant '").append(name) + .append("' from file '").append(fileName) + .append("' with ref '").append(fileRef) + .append("' of type '" + tensorType) + .append("'"); + return b.toString(); + } +} |