src/core/net/sf/basedb/util/extensions/manager/ObjectKey.java

Code
Comments
Other
Rev Date Author Line
5602 07 Apr 11 nicklas 1 /**
5602 07 Apr 11 nicklas 2   $Id$
5602 07 Apr 11 nicklas 3
5602 07 Apr 11 nicklas 4   Copyright (C) 2011 Nicklas Nordborg
5602 07 Apr 11 nicklas 5
5602 07 Apr 11 nicklas 6   This file is part of BASE - BioArray Software Environment.
5602 07 Apr 11 nicklas 7   Available at http://base.thep.lu.se/
5602 07 Apr 11 nicklas 8
5602 07 Apr 11 nicklas 9   BASE is free software; you can redistribute it and/or
5602 07 Apr 11 nicklas 10   modify it under the terms of the GNU General Public License
5602 07 Apr 11 nicklas 11   as published by the Free Software Foundation; either version 3
5602 07 Apr 11 nicklas 12   of the License, or (at your option) any later version.
5602 07 Apr 11 nicklas 13
5602 07 Apr 11 nicklas 14   BASE is distributed in the hope that it will be useful,
5602 07 Apr 11 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
5602 07 Apr 11 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5602 07 Apr 11 nicklas 17   GNU General Public License for more details.
5602 07 Apr 11 nicklas 18
5602 07 Apr 11 nicklas 19   You should have received a copy of the GNU General Public License
5602 07 Apr 11 nicklas 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
5602 07 Apr 11 nicklas 21 */
5602 07 Apr 11 nicklas 22 package net.sf.basedb.util.extensions.manager;
5602 07 Apr 11 nicklas 23
5602 07 Apr 11 nicklas 24 /**
5602 07 Apr 11 nicklas 25   Instances of object keys should be something that uniquely
5602 07 Apr 11 nicklas 26   identifies an object that has been defined by an extension.
5602 07 Apr 11 nicklas 27   Object keys are mainly used to lookup in which file a
5602 07 Apr 11 nicklas 28   certain object has been defined 
5602 07 Apr 11 nicklas 29   (see {@link ExtensionsManager#getFileByObjectKey(ObjectKey)})
5602 07 Apr 11 nicklas 30   and/or to get information about the object itself 
5602 07 Apr 11 nicklas 31   (see {@link ExtensionsFile#getObjectForKey(ObjectKey)})
5602 07 Apr 11 nicklas 32   <p>
5602 07 Apr 11 nicklas 33   
5606 14 Apr 11 nicklas 34   It is up to the actual implementations to decide what actually 
5606 14 Apr 11 nicklas 35   makes up a key that can be used to identify an object. Implementors
5602 07 Apr 11 nicklas 36   of this interface should implement <code>equals()</code> and
5602 07 Apr 11 nicklas 37   <code>hashCode()</code> methods to only match with it's
5602 07 Apr 11 nicklas 38   own class. Implementations should be immutable.
5602 07 Apr 11 nicklas 39   
5602 07 Apr 11 nicklas 40   @author Nicklas
5602 07 Apr 11 nicklas 41   @since 3.0
5602 07 Apr 11 nicklas 42   @base.modified $Date$
5602 07 Apr 11 nicklas 43   @see ExtensionsManager#getFileByObjectKey(ObjectKey)
5602 07 Apr 11 nicklas 44   @see ExtensionsFile#getObjectForKey(ObjectKey)
5602 07 Apr 11 nicklas 45   @param <O> The type of object that the key references
5602 07 Apr 11 nicklas 46 */
5602 07 Apr 11 nicklas 47 public interface ObjectKey<O>
5606 14 Apr 11 nicklas 48 {
5606 14 Apr 11 nicklas 49   /**
5606 14 Apr 11 nicklas 50     Get a string description of the key that is suitable for use
5606 14 Apr 11 nicklas 51     in (error) messages to users.
5606 14 Apr 11 nicklas 52   */
5606 14 Apr 11 nicklas 53   public String toDescription();
5606 14 Apr 11 nicklas 54 }