Name (Java SE 16 & JDK 16) (original) (raw)

All Superinterfaces:

[Cloneable](../../../java.base/java/lang/Cloneable.html "interface in java.lang"), [Comparable](../../../java.base/java/lang/Comparable.html "interface in java.lang")<[Object](../../../java.base/java/lang/Object.html "class in java.lang")>, [Serializable](../../../java.base/java/io/Serializable.html "interface in java.io")

All Known Implementing Classes:

[CompositeName](CompositeName.html "class in javax.naming"), [CompoundName](CompoundName.html "class in javax.naming"), [LdapName](ldap/LdapName.html "class in javax.naming.ldap")


The Name interface represents a generic name -- an ordered sequence of components. It can be a composite name (names that span multiple namespaces), or a compound name (names that are used within individual hierarchical naming systems).

There can be different implementations of Name; for example, composite names, URLs, or namespace-specific compound names.

The components of a name are numbered. The indexes of a name with N components range from 0 up to, but not including, N. This range may be written as [0,N). The most significant component is at index 0. An empty name has no components.

None of the methods in this interface accept null as a valid value for a parameter that is a name or a name component. Likewise, methods that return a name or name component never return null.

An instance of a Name may not be synchronized against concurrent multithreaded access if that access is not read-only.

Since:

1.3

Fields

Adds a single component at a specified position within this name.
Adds a single component to the end of this name.
[addAll](#addAll%28int,javax.naming.Name%29)​(int posn,[Name](Name.html "interface in javax.naming") n)
Adds the components of a name -- in order -- at a specified position within this name.
Adds the components of a name -- in order -- to the end of this name.
[clone](#clone%28%29)()
Generates a new copy of this name.
int
Compares this name with another name for order.
boolean
Determines whether this name ends with a specified suffix.
[get](#get%28int%29)​(int posn)
Retrieves a component of this name.
[getAll](#getAll%28%29)()
Retrieves the components of this name as an enumeration of strings.
[getPrefix](#getPrefix%28int%29)​(int posn)
Creates a name whose components consist of a prefix of the components of this name.
[getSuffix](#getSuffix%28int%29)​(int posn)
Creates a name whose components consist of a suffix of the components in this name.
boolean
[isEmpty](#isEmpty%28%29)()
Determines whether this name is empty.
[remove](#remove%28int%29)​(int posn)
Removes a component from this name.
int
[size](#size%28%29)()
Returns the number of components in this name.
boolean
Determines whether this name starts with a specified prefix.