From 7ad16a07b4288227c531c485939318768129fb54 Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 3 Aug 2011 09:20:48 +0000 Subject: Tag debug mod for TUSCANY-3909 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1153403 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sca/domain/search/Result.java | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sca-java-1.x/tags/1.6.1-TUSCANY-3909/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/Result.java (limited to 'sca-java-1.x/tags/1.6.1-TUSCANY-3909/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/Result.java') diff --git a/sca-java-1.x/tags/1.6.1-TUSCANY-3909/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/Result.java b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/Result.java new file mode 100644 index 0000000000..edbebac6b4 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-TUSCANY-3909/domain-search/src/main/java/org/apache/tuscany/sca/domain/search/Result.java @@ -0,0 +1,121 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tuscany.sca.domain.search; + +import java.io.Serializable; +import java.util.Map; + +/** + *

+ * The object that implements this interface carries a search's result data. + *

+ *

+ * A result contains a value, which is the value displayed to the user. It also + * contains a field name, which is the field the value is related to. + *

+ *

+ * A search result may be split into different {@link Result} objects, each one + * contained inside other, representing a complex result hierarchy. For example: + * a result structure may represent as result a folder and files/folders + * contained in it. + *

+ * + * @see ResultProcessor + * @see ResultFactory + * + * @version $Rev$ $Date$ + */ +public interface Result extends Serializable { + + /** + * Returns the value held by this object. + * + * @return the value held by this object + */ + String getValue(); + + /** + * Sets the result value. + * + * @param value the result value + */ + void setValue(String value); + + /** + * Returns the {@link Result} object that contains this object or + * null if it's not contained in any object. + * + * @return the {@link Result} object that contains this object or + * null if it's not contained in any object + */ + Result getContainer(); + + /** + * A {@link Map} containing {@link Result} objects contained in this + * {@link Object}. The contents are mapped from a key, which may be any kind + * of identifier, the identifier is chosen by the {@link Result} + * implementation. + * + * @return the contents map + */ + Map getContents(); + + /** + * Adds a {@link Result} content to this result. + * + * @param artifactResult the {@link Result} content + * @throw {@link UnsupportedOperationException} if the {@link Result} + * implementations does not support this operation + * @see #getContents() + */ + void addContent(Result artifactResult); + + /** + * Removes a {@link Result} content from this result. + * + * @param artifactResult the {@link Result} content + * @throw {@link UnsupportedOperationException} if the {@link Result} + * implementations does not support this operation + * @see #getContents() + */ + void removeContent(Result artifactResult); + + /** + * Sets this object's container. + * + * @param container the object's container + * @see #getContainer() + */ + void setContainer(Result container); + + /** + * Returns the field related to the result's value. + * + * @return the field name + */ + String getField(); + + /** + * Sets the field related to the result's value. + * + * @param field the field name + */ + void setField(String field); + +} -- cgit v1.2.3