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.context.sensor;
23  
24  import org.apache.commons.collections.KeyValue;
25  
26  /***
27   * A sensor is an object that looks up information for a token, for example
28   * semantic information from gazetteers or thesauri.
29   *
30   * @author Christian Siefkes
31   * @version $Revision: 1.2 $, $Date: 2004/07/07 08:15:29 $, $Author: siefkes $
32   */
33  public interface Sensor {
34  
35      /***
36       * Looks up a token and returns the information as an array of key/value
37       * pairs (values can be <code>null</code>, but <code>null</code> are not
38       * allowed). If no information for the given token can be found, an
39       * empty array (length 0) is returned.
40       *
41       * @param token the token to look up
42       * @return an array of key/value pairs describing the token
43       */
44      KeyValue[] lookup(final String token);
45  
46  }