1   /*
2    *  Copyright (c) 1998-2001, The University of Sheffield.
3    *
4    *  This file is part of GATE (see http://gate.ac.uk/), and is free
5    *  software, licenced under the GNU Library General Public License,
6    *  Version 2, June 1991 (in the distribution as file licence.html,
7    *  and also available at http://gate.ac.uk/gate/licence.html).
8    *
9    *  Valentin Tablan 28 May 2002
10   *
11   *  $Id: AttributeDetector.java,v 1.1 2002/06/27 17:12:32 valyt Exp $
12   */
13  
14  package gate.ml;
15  
16  import weka.core.*;
17  /**
18   */
19  public interface AttributeDetector{
20  
21    /**
22     * Gets the definition for the attribute handled by this detector.
23     * @return an Attribute object.
24     */
25    public Attribute getAttribute();
26  
27  
28    /**
29     * Gets the value detected for the attribute in the current instance.
30     * If <code>null</code> is returned, the attribute will be marked as missing.
31     * @return An Object value. This will be converted to the according numeric
32     * type or to string.
33     * @param data contains tha data neede to identify the instance for which the
34     * attribute value is requested. The actual type of the value depends on the
35     * type of InstanceDetector used.
36     */
37    public Object getAttributeValue(Object data);
38  
39    /**
40     * Sets the data collector this data listener lives into.
41     * @param collector
42     */
43    public void setDataCollector(DataCollector collector);
44  }