001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.uml.core.metamodel.core.foundation;
043:
044: import org.netbeans.modules.uml.core.metamodel.infrastructure.coreinfrastructure.IBehavioralFeature;
045: import org.netbeans.modules.uml.core.support.umlutils.ETList;
046:
047: /**
048: * <p>Title: </p>
049: * <p>Description: </p>
050: * <p>Copyright: Copyright (c) 2003</p>
051: * <p>Company: </p>
052: * @author not attributable
053: * @version 1.0
054: */
055:
056: public interface INamedElement extends IElement {
057:
058: // Sets / Gets the name of this element.
059: // HRESULT Name([out, retval] BSTR* curVal );
060: public String getName();
061:
062: // Sets / Gets the name of this element.
063: // HRESULT Name([in] BSTR newName );
064: public void setName(String str);
065:
066: // Sets / Gets the visibility of this element.
067: // HRESULT Visibility([out, retval] VisibilityKind* vis );
068: public int getVisibility();
069:
070: // Sets / Gets the visibility of this element.
071: // HRESULT Visibility([in] VisibilityKind vis );
072: public void setVisibility(int vis);
073:
074: // Sets / Gets the Namespace of this element.
075: // HRESULT Namespace([out, retval] INamespace** curSpace );
076: public INamespace getNamespace();
077:
078: // Sets / Gets the Namespace of this element.
079: // HRESULT Namespace([in] INamespace* space );
080: public void setNamespace(INamespace space);
081:
082: // Adds a supplier dependency relationship to this element.
083: // HRESULT AddSupplierDependency([in] IDependency* dep );
084: public void addSupplierDependency(IDependency dep);
085:
086: // Removes a supplier dependency relationship from this element.
087: // HRESULT RemoveSupplierDependency([in] IDependency* dep );
088: public void removeSupplierDependency(IDependency dep);
089:
090: // Retrieves the collection of Dependencies where this element plays the supplier role.
091: // HRESULT SupplierDependencies([out, retval] IDependencies** deps);
092: public ETList<IDependency> getSupplierDependencies();
093:
094: // Retrieves the collection of Dependencies where this element plays the supplier role. The Dependencies are of type sElementType.
095: // HRESULT SupplierDependenciesByType([in]BSTR sElementType, [out, retval] IDependencies** deps);
096: public ETList<IDependency> getSupplierDependenciesByType(String type);
097:
098: // Adds a client dependency relationship to this element.
099: // HRESULT AddClientDependency([in] IDependency* dep );
100: public void addClientDependency(IDependency dep);
101:
102: // Removes a client dependency relationship from this element.
103: // HRESULT RemoveClientDependency([in] IDependency* dep );
104: public void removeClientDependency(IDependency dep);
105:
106: // Retrieves the collection of Dependencies where this element plays the client role.
107: // HRESULT ClientDependencies([out, retval] IDependencies** deps );
108: public ETList<IDependency> getClientDependencies();
109:
110: // Retrieves the collection of Dependencies where this element plays the client role. The Dependencies are of type sElementType.
111: // HRESULT ClientDependenciesByType([in]BSTR sElementType, [out, retval] IDependencies** deps);
112: public ETList<IDependency> getClientDependenciesByType(String type);
113:
114: // Retrieves the fully qualified name of the element. Project name is included based on the user preference. This will be in the form '[ProjectName::]A::B::C'.
115: // HRESULT QualifiedName([out, retval] BSTR* name );
116: public String getQualifiedName();
117:
118: // Retrieves the fully qualified name of the element. This will be in the form '[ProjectName::]A::B::C'.
119: // HRESULT FullyQualifiedName([in] VARIANT_BOOL useProjectName, [out, retval] BSTR* name );
120: public String getFullyQualifiedName(boolean useProjName);
121:
122: // Used to establish a different name for this element.
123: // HRESULT Alias([out, retval] BSTR* curVal );
124: public String getAlias();
125:
126: // Used to establish a different name for this element.
127: // HRESULT Alias([in] BSTR newName );
128: public void setAlias(String str);
129:
130: // Does this element have an aliased name?
131: // HRESULT IsAliased([out, retval] VARIANT_BOOL* bIsAliased );
132: public boolean isAliased();
133:
134: // .
135: // HRESULT SupplierDependencyCount([out, retval] long* pVal);
136: public long getSupplierDependencyCount();
137:
138: // .
139: // HRESULT ClientDependencyCount([out, retval] long* pVal);
140: public long getClientDependencyCount();
141:
142: // Retrieves the fully qualified name of the element. Project name is never included. This will be in the form 'A::B::C'.
143: // HRESULT QualifiedName2([out, retval] BSTR* name );
144: public String getQualifiedName2();
145:
146: public boolean isNameSame(IBehavioralFeature feature);
147:
148: public String getNameWithAlias();
149:
150: public void setNameWithAlias(String newVal);
151:
152: /**
153: * The default behavior to this method is to return true if the names of the
154: * two elements being compared are same. Subclasses should override to
155: * implement class specific <em>isSimilar</em> behavior.
156: *
157: * @param other The other named element to compare this named element to.
158: * @return true, if the names are the same, otherwise, false.
159: */
160: public boolean isSimilar(INamedElement other);
161: }
|