]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.workbench.search/src/org/simantics/workbench/search/QueryResult.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.workbench.search / src / org / simantics / workbench / search / QueryResult.java
diff --git a/bundles/org.simantics.workbench.search/src/org/simantics/workbench/search/QueryResult.java b/bundles/org.simantics.workbench.search/src/org/simantics/workbench/search/QueryResult.java
new file mode 100644 (file)
index 0000000..7cb4391
--- /dev/null
@@ -0,0 +1,48 @@
+/*******************************************************************************\r
+ * Copyright (c) 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.workbench.search;\r
+\r
+import org.simantics.utils.datastructures.map.Tuple;\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class QueryResult extends Tuple {\r
+\r
+    public QueryResult(String html, int hits) {\r
+        this("",html,"", hits);\r
+    }\r
+    \r
+    public QueryResult(String header, String content, String footer, int hits) {\r
+        super(header,content,footer, hits);\r
+    }\r
+    \r
+    public String getHeader() {\r
+        return (String) getField(0);\r
+    }\r
+    public String getContent() {\r
+        return (String) getField(1);\r
+    }\r
+    \r
+    public String getFooter() {\r
+        return (String) getField(2);\r
+    }\r
+\r
+    public String getHtml() {\r
+        return getHeader() + getContent() + getFooter();\r
+    }\r
+\r
+    public int getHitCount() {\r
+        return (Integer) getField(3);\r
+    }\r
+\r
+}
\ No newline at end of file