public class QName
extends java.lang.Object
implements javax.naming.Name
Modifier and Type | Field and Description |
---|---|
protected javax.naming.Context |
_context |
Constructor and Description |
---|
QName(javax.naming.Context context)
Creates a root name based on a context.
|
QName(javax.naming.Context context,
java.lang.String first)
Creates a new name with a single component.
|
QName(javax.naming.Context context,
java.lang.String first,
java.lang.String rest)
Creates a new name with two components
|
Modifier and Type | Method and Description |
---|---|
javax.naming.Name |
add(int posn,
java.lang.String comp)
Add a component at a specific position, returning the name.
|
javax.naming.Name |
add(java.lang.String comp)
Add a component to the tail of the name, returning the name.
|
javax.naming.Name |
addAll(int posn,
javax.naming.Name suffix)
Insert a name to the current name.
|
javax.naming.Name |
addAll(javax.naming.Name suffix)
Append a name to the current name.
|
java.lang.Object |
clone()
Clones the name.
|
int |
compareTo(java.lang.Object rawB)
Compares the name to another name.
|
boolean |
endsWith(javax.naming.Name name) |
boolean |
equals(java.lang.Object obj)
Returns true if the object is an equivalent name.
|
java.lang.String |
get(int pos) |
java.util.Enumeration |
getAll() |
javax.naming.Name |
getPrefix(int posn) |
javax.naming.Name |
getSuffix(int posn) |
int |
hashCode()
Returns the name's hash code.
|
boolean |
isEmpty() |
java.lang.Object |
remove(int posn) |
int |
size() |
boolean |
startsWith(javax.naming.Name name)
Returns true if the argument is a prefix of the name.
|
java.lang.String |
toString()
Converts the name to a string.
|
public QName(javax.naming.Context context)
context
- the root contextpublic QName(javax.naming.Context context, java.lang.String first)
context
- the root contextfirst
- the first name componentpublic QName(javax.naming.Context context, java.lang.String first, java.lang.String rest)
context
- the root contextfirst
- the first name componenttail
- the tail name componentpublic java.lang.Object clone()
clone
in interface javax.naming.Name
clone
in class java.lang.Object
public int size()
size
in interface javax.naming.Name
public boolean isEmpty()
isEmpty
in interface javax.naming.Name
public java.util.Enumeration getAll()
getAll
in interface javax.naming.Name
public java.lang.String get(int pos)
get
in interface javax.naming.Name
public javax.naming.Name getPrefix(int posn)
getPrefix
in interface javax.naming.Name
public javax.naming.Name getSuffix(int posn)
getSuffix
in interface javax.naming.Name
public boolean startsWith(javax.naming.Name name)
startsWith
in interface javax.naming.Name
name
- the Name to start as a prefix.public boolean endsWith(javax.naming.Name name)
endsWith
in interface javax.naming.Name
public javax.naming.Name addAll(javax.naming.Name suffix) throws javax.naming.InvalidNameException
addAll
in interface javax.naming.Name
suffix
- the name to add as a suffixjavax.naming.InvalidNameException
public javax.naming.Name addAll(int posn, javax.naming.Name suffix) throws javax.naming.InvalidNameException
addAll
in interface javax.naming.Name
suffix
- the name to add as a suffixjavax.naming.InvalidNameException
public javax.naming.Name add(java.lang.String comp) throws javax.naming.InvalidNameException
add
in interface javax.naming.Name
comp
- the new component to add.javax.naming.InvalidNameException
public javax.naming.Name add(int posn, java.lang.String comp) throws javax.naming.InvalidNameException
add
in interface javax.naming.Name
javax.naming.InvalidNameException
public java.lang.Object remove(int posn) throws javax.naming.InvalidNameException
remove
in interface javax.naming.Name
javax.naming.InvalidNameException
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to test for equality.public int compareTo(java.lang.Object rawB)
compareTo
in interface java.lang.Comparable<java.lang.Object>
compareTo
in interface javax.naming.Name
public java.lang.String toString()
toString
in class java.lang.Object