src/core/net/sf/basedb/util/export/spotdata/ExportableField.java

Code
Comments
Other
Rev Date Author Line
4925 08 May 09 nicklas 1 /**
4925 08 May 09 nicklas 2   $Id$
4925 08 May 09 nicklas 3
4925 08 May 09 nicklas 4   Copyright (C) 2009 Nicklas Nordborg
4925 08 May 09 nicklas 5
4925 08 May 09 nicklas 6   This file is part of BASE - BioArray Software Environment.
4925 08 May 09 nicklas 7   Available at http://base.thep.lu.se/
4925 08 May 09 nicklas 8
4925 08 May 09 nicklas 9   BASE is free software; you can redistribute it and/or
4925 08 May 09 nicklas 10   modify it under the terms of the GNU General Public License
4925 08 May 09 nicklas 11   as published by the Free Software Foundation; either version 3
4925 08 May 09 nicklas 12   of the License, or (at your option) any later version.
4925 08 May 09 nicklas 13
4925 08 May 09 nicklas 14   BASE is distributed in the hope that it will be useful,
4925 08 May 09 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
4925 08 May 09 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4925 08 May 09 nicklas 17   GNU General Public License for more details.
4925 08 May 09 nicklas 18
4925 08 May 09 nicklas 19   You should have received a copy of the GNU General Public License
4925 08 May 09 nicklas 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
4925 08 May 09 nicklas 21 */
4925 08 May 09 nicklas 22 package net.sf.basedb.util.export.spotdata;
4925 08 May 09 nicklas 23
5319 20 Apr 10 nicklas 24 import net.sf.basedb.core.Type;
4925 08 May 09 nicklas 25 import net.sf.basedb.util.formatter.Formatter;
4925 08 May 09 nicklas 26
4925 08 May 09 nicklas 27 /**
4925 08 May 09 nicklas 28   Interface that represents an exportable field.
5385 13 Aug 10 nicklas 29   It is recommended that implementations override {@link Object#equals(Object)}
5385 13 Aug 10 nicklas 30   and {@link Object#hashCode()} methods to make it possible for users
5319 20 Apr 10 nicklas 31   to check if a given field is present or not in a list of already
5319 20 Apr 10 nicklas 32   existing fields. A typical implementation should only compare itself
5319 20 Apr 10 nicklas 33   to fields of the same class that export the same information with the
5319 20 Apr 10 nicklas 34   same title.
4925 08 May 09 nicklas 35
4925 08 May 09 nicklas 36   @author Nicklas
4925 08 May 09 nicklas 37   @version 2.12
4925 08 May 09 nicklas 38   @base.modified $Date$
4925 08 May 09 nicklas 39 */
4925 08 May 09 nicklas 40 public interface ExportableField
4925 08 May 09 nicklas 41 {
4925 08 May 09 nicklas 42
4925 08 May 09 nicklas 43   /**
4925 08 May 09 nicklas 44     Get the column header.
4925 08 May 09 nicklas 45   */
4925 08 May 09 nicklas 46   public String getTitle();
4925 08 May 09 nicklas 47
4925 08 May 09 nicklas 48   /**
5319 20 Apr 10 nicklas 49     Get the data type of the field.
5319 20 Apr 10 nicklas 50     @return A type object or null if not known
5319 20 Apr 10 nicklas 51     @since 2.15
5319 20 Apr 10 nicklas 52   */
5319 20 Apr 10 nicklas 53   public Type getType();
5319 20 Apr 10 nicklas 54   
5319 20 Apr 10 nicklas 55   /**
4925 08 May 09 nicklas 56     Get a formatter that converts the values in this field to strings.
4925 08 May 09 nicklas 57     @return A formatter or null to use default formatting (normally this means
4925 08 May 09 nicklas 58       calling the toString() method).
4925 08 May 09 nicklas 59   */
4925 08 May 09 nicklas 60   public Formatter<?> getFormatter();
4925 08 May 09 nicklas 61   
4925 08 May 09 nicklas 62 }