View Javadoc

1   /*
2    * Copyright (C) 2004 Christian Siefkes <christian@siefkes.net>.
3    * Development of this software is supported by the German Research Society,
4    * Berlin-Brandenburg Graduate School in Distributed Information Systems
5    * (DFG grant no. GRK 316).
6    *
7    * This library is free software; you can redistribute it and/or
8    * modify it under the terms of the GNU Lesser General Public
9    * License as published by the Free Software Foundation; either
10   * version 2.1 of the License, or (at your option) any later version.
11   *
12   * This library is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this library; if not, visit
19   * http://www.gnu.org/licenses/lgpl.html or write to the Free Software
20   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
21   */
22  package de.fu_berlin.ties.eval;
23  
24  import java.util.Set;
25  
26  import de.fu_berlin.ties.io.StorableContainer;
27  
28  /***
29   * A read-only view of multiple {@link de.fu_berlin.ties.eval.FMetrics}
30   * and the sums and averages calculated over them.
31   *
32   * @author Christian Siefkes
33   * @version $Revision: 1.3 $, $Date: 2004/02/19 18:15:51 $, $Author: siefkes $
34   */
35  public interface MultiFMetricsView extends StorableContainer {
36  
37      /***
38       * Returns the set of all types (Strings) currently stored in this
39       * instance. The set is immutable and cannot modified.
40       *
41       * @return the set of type names
42       */
43      Set types();
44  
45      /***
46       * Returns a read-only view of the {@link FMetrics} of the specified type.
47       * This is not a snapshot but will change whenever the underlying counts
48       * are changed.
49       *
50       * @param type the type to check
51       * @return a view of the counts and evaluation metrics for the given type;
52       * or <code>null</code> if no metrics exist for the given type
53       */
54      FMetricsView view(final String type);
55  
56      /***
57       * Returns a read-only view of the {@link FMetrics} containing the sums and
58       * averages over all types. This is not a snapshot but will change whenever
59       * the underlying counts are changed.
60       *
61       * @return a view of the sums and averages over all types
62       */
63      FMetricsView viewAll();
64  
65      /***
66       * Optional operation that shows {@link FMetricsSummary statistical
67       * summaries of precision, recall, and F1 metrics} over all types,
68       * if calculated by the used implementation. This is not a snapshot but
69       * will change whenever the underlying values are changed.
70       *
71       * @return a statistical summery over the metrics of all types
72       * @throws UnsupportedOperationException if this method is not supported by
73       * the used implementation
74       */
75      FMetricsSummary viewAllSummary() throws UnsupportedOperationException;
76  
77      /***
78       * Optional operation that shows {@link FMetricsSummary statistical
79       * summaries of precision, recall, and F1 metrics} of the specified type,
80       * if calculated by the used implementation. This is not a snapshot but
81       * will change whenever the underlying values are changed.
82       *
83       * @param type the type to check
84       * @return a statistical summery over the metrics of the given type
85       * @throws UnsupportedOperationException if this method is not supported by
86       * the used implementation
87       */
88      FMetricsSummary viewSummary(final String type)
89              throws UnsupportedOperationException;
90  
91  }