1 /*=========================================================================== 2 3 ObjectWeb Naming Context Framework 4 Copyright (C) 2002 USTL - LIFL - GOAL 5 Contact: architecture@objectweb.org 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 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, write to the Free Software 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 20 USA 21 22 Initial developer(s): Philippe Merle. 23 Contributor(s): ______________________________________. 24 25 ===========================================================================*/ 26 27 package org.objectweb.util.browser.core.api; 28 29 /** 30 * Names are non-mutable structures representing names used by contexts. 31 * 32 * A Name is a pair <id,subname>, 33 * where id is an identifier represented as a String, 34 * and subname a (possibly null) Name. 35 * 36 * The "" identifier is reserved in contexts representing trees 37 * to represent the root of the tree. 38 * 39 * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a> 40 * @version 0.1 41 * 42 * Note: This is strongly inspired from the Jonathan naming context framework 43 * initially developped by Fabien Delpiano and Bruno Dumant. 44 */ 45 public interface Name { 46 47 /** 48 * The standard name of this interface to use 49 * in the context of the Fractal framework. 50 */ 51 static final String NAME = Name.class.getName(); 52 53 /** 54 * Gets the id of the target name. 55 * 56 * This method does not update the id of the target name. 57 * 58 * @return The id of the target name. 59 * 60 * @postcondition return == getOWId(); 61 */ 62 String getOWId(); 63 64 /** 65 * Gets the subname of the target name. 66 * 67 * This method does not update the subname of the target name. 68 * 69 * @return the subname of the target name. 70 * 71 * @postcondition return == getOWSubName(); 72 */ 73 Name getOWSubName(); 74 75 /** 76 * Tests if a given name is equals to the target name. 77 * 78 * @param name The given name. 79 * 80 * @return 81 * true if the given name is the same object of the target name, 82 * or if the id and the subname of the given name are equals to 83 * respectively the id and subname of the target name; 84 * false otherwise. 85 * 86 * @postcondition 87 * result == (name == this) 88 * or ( name.getOWId().equals(this.getOWId()) 89 * and name.getOWSubName().equals(this.getOWSubName()) ); 90 */ 91 boolean equals(Name name); 92 93 } 94