|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.argouml.uml.util.namespace.StringNamespace
A StringNamespace is a string based namespace (StringNamespaceElement) object. It faciliates creation of these objects via a number of helper methods.
| Field Summary | |
private Stack |
ns
|
private String |
token
|
| Fields inherited from interface org.argouml.uml.util.namespace.Namespace |
CPP_NS_TOKEN, JAVA_NS_TOKEN, UML_NS_TOKEN |
| Constructor Summary | |
StringNamespace()
Constructor. |
|
StringNamespace(NamespaceElement[] elements)
Construct a namespace from NamespaceElements with default scope token. |
|
StringNamespace(NamespaceElement[] elements,
String theToken)
Construct a namespace from NamespaceElements with given scope token. |
|
StringNamespace(String theToken)
empty namespace with given default token. |
|
StringNamespace(String[] elements)
construct a namespace from an array of strings with default scope token. |
|
StringNamespace(String[] elements,
String theToken)
construct a namespace from strings with given scope token. |
|
| Method Summary | |
boolean |
equals(Object namespace)
Two namespaces are equal when they are namespaces and have the same string representation. |
Namespace |
getBaseNamespace()
returns the base of a namespace, e.g. |
Namespace |
getCommonNamespace(Namespace namespace)
returns the namespace which is common to both namespaces, e.g. |
int |
hashCode()
|
boolean |
isEmpty()
check if the namespace is empty. |
Iterator |
iterator()
return an iterator to the namespace elements. |
static Namespace |
parse(Class c)
parse the name of a (java) class. |
static Namespace |
parse(String fqn,
String token)
parse a fully qualified namespace to create a Namespace object. |
NamespaceElement |
peekNamespaceElement()
return the innermost namespace element without removing it. |
NamespaceElement |
popNamespaceElement()
reduces the innermost namespace element, e.g. |
void |
pushNamespaceElement(NamespaceElement element)
add another element to a namespace. |
void |
pushNamespaceElement(String element)
Store the next namespace element. |
void |
setDefaultScopeToken(String theToken)
namespaces usually have a scope operator when used in representational form. |
String |
toString()
Create a string representation using the default scope token. |
String |
toString(String theToken)
return a string representation of the namespace with the given token. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private Stack ns
private String token
| Constructor Detail |
public StringNamespace()
public StringNamespace(String theToken)
theToken - the scope seperator to usepublic StringNamespace(String[] elements)
elements - an array of strings which represent the namespace.
public StringNamespace(String[] elements,
String theToken)
elements - an array of strings which represent the namespace.theToken - scope token to use
public StringNamespace(NamespaceElement[] elements,
String theToken)
elements - array of NamespaceElementstheToken - scope tokenpublic StringNamespace(NamespaceElement[] elements)
elements - array of NamespaceElements| Method Detail |
public void pushNamespaceElement(NamespaceElement element)
Namespace
pushNamespaceElement in interface Namespaceelement - the element to addNamespace.pushNamespaceElement(NamespaceElement)public NamespaceElement peekNamespaceElement()
Namespace
peekNamespaceElement in interface NamespaceNamespace.peekNamespaceElement()public void pushNamespaceElement(String element)
element - The element to store.Namespace.popNamespaceElement()public NamespaceElement popNamespaceElement()
Namespaceorg.argouml.model
will return model, and change the namespace
to org.argouml.
popNamespaceElement in interface NamespaceNamespace.popNamespaceElement()public Namespace getBaseNamespace()
Namespaceorg.argouml.util
is org.argouml.
getBaseNamespace in interface NamespaceNamespace.getBaseNamespace()public Namespace getCommonNamespace(Namespace namespace)
Namespaceorg.argouml.model
and org.argouml.util have org.argouml in
common.
getCommonNamespace in interface Namespacenamespace - a namespace
Namespace.getCommonNamespace(
org.argouml.uml.util.namespace.Namespace)public Iterator iterator()
Namespace
iterator in interface NamespaceNamespace.iterator()public boolean isEmpty()
Namespace
isEmpty in interface NamespaceNamespace.isEmpty()public void setDefaultScopeToken(String theToken)
Namespace
setDefaultScopeToken in interface NamespacetheToken - the token to use from now on.Namespace.setDefaultScopeToken(java.lang.String)
public static Namespace parse(String fqn,
String token)
fqn - string representation of namespacetoken - the token of the namespace
public static Namespace parse(Class c)
c - the class
public int hashCode()
Object.hashCode()public boolean equals(Object namespace)
namespace - the namespace to compare with
Object.equals(java.lang.Object)public String toString(String theToken)
Namespace
toString in interface NamespacetheToken - the token to be converted
Namespace.toString(java.lang.String)public String toString()
Object.toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
| ArgoUML © 1996-2005 | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |