src/java.naming/share/classes/javax/naming/Name.java
author darcy
Fri, 17 Aug 2018 13:37:01 -0700
changeset 51437 6221a199ec20
parent 51317 e122220d7d7e
permissions -rw-r--r--
8209304: Deprecate serialVersionUID fields in interfaces Reviewed-by: lancea, mullan, rriggs, smarks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
51317
e122220d7d7e 8209024: Use SuppressWarnings on serialVersionUID fields in interfaces
darcy
parents: 47216
diff changeset
     2
 * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.naming;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.Enumeration;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    31
 * The {@code Name} interface represents a generic name -- an ordered
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * sequence of components.  It can be a composite name (names that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * span multiple namespaces), or a compound name (names that are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * used within individual hierarchical naming systems).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    36
 * <p> There can be different implementations of {@code Name}; for example,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * composite names, URLs, or namespace-specific compound names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <p> The components of a name are numbered.  The indexes of a name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * with N components range from 0 up to, but not including, N.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * range may be written as [0,N).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * The most significant component is at index 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * An empty name has no components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * <p> None of the methods in this interface accept null as a valid
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * value for a parameter that is a name or a name component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * Likewise, methods that return a name or name component never return null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    49
 * <p> An instance of a {@code Name} may not be synchronized against
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * concurrent multithreaded access if that access is not read-only.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * @author Rosanna Lee
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * @author Scott Seligman
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * @author R. Vasudevan
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
public interface Name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    extends Cloneable, java.io.Serializable, Comparable<Object>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    * The class fingerprint that is set to indicate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    * serialization compatibility with a previous
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    * version of the class.
51437
6221a199ec20 8209304: Deprecate serialVersionUID fields in interfaces
darcy
parents: 51317
diff changeset
    66
    *
6221a199ec20 8209304: Deprecate serialVersionUID fields in interfaces
darcy
parents: 51317
diff changeset
    67
    * @deprecated A {@code serialVersionUID} field in an interface is
6221a199ec20 8209304: Deprecate serialVersionUID fields in interfaces
darcy
parents: 51317
diff changeset
    68
    * ineffectual. Do not use; no replacement.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    */
51437
6221a199ec20 8209304: Deprecate serialVersionUID fields in interfaces
darcy
parents: 51317
diff changeset
    70
    @Deprecated
6221a199ec20 8209304: Deprecate serialVersionUID fields in interfaces
darcy
parents: 51317
diff changeset
    71
    @SuppressWarnings("serial")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    static final long serialVersionUID = -3617482732056931635L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * Generates a new copy of this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * Subsequent changes to the components of this name will not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * affect the new copy, and vice versa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * @return  a copy of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * @see Object#clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    public Object clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * Compares this name with another name for order.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * Returns a negative integer, zero, or a positive integer as this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * name is less than, equal to, or greater than the given name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    90
     * <p> As with {@code Object.equals()}, the notion of ordering for names
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * depends on the class that implements this interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * For example, the ordering may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * based on lexicographical ordering of the name components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * Specific attributes of the name, such as how it treats case,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * may affect the ordering.  In general, two names of different
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * classes may not be compared.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * @param   obj the non-null object to compare against.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @return  a negative integer, zero, or a positive integer as this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     *          is less than, equal to, or greater than the given name
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   101
     * @throws  ClassCastException if obj is not a {@code Name} of a
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     *          type that may be compared with this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * @see Comparable#compareTo(Object)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    public int compareTo(Object obj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * Returns the number of components in this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * @return  the number of components in this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    public int size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * Determines whether this name is empty.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * An empty name is one with zero components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @return  true if this name is empty, false otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    public boolean isEmpty();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * Retrieves the components of this name as an enumeration
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * of strings.  The effect on the enumeration of updates to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * this name is undefined.  If the name has zero components,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * an empty (non-null) enumeration is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @return  an enumeration of the components of this name, each a string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    public Enumeration<String> getAll();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * Retrieves a component of this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     *          the 0-based index of the component to retrieve.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *          Must be in the range [0,size()).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @return  the component at index posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     *          if posn is outside the specified range
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    public String get(int posn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * Creates a name whose components consist of a prefix of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * components of this name.  Subsequent changes to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * this name will not affect the name that is returned and vice versa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     *          the 0-based index of the component at which to stop.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     *          Must be in the range [0,size()].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @return  a name consisting of the components at indexes in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *          the range [0,posn).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     *          if posn is outside the specified range
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    public Name getPrefix(int posn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * Creates a name whose components consist of a suffix of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * components in this name.  Subsequent changes to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * this name do not affect the name that is returned and vice versa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     *          the 0-based index of the component at which to start.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     *          Must be in the range [0,size()].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * @return  a name consisting of the components at indexes in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     *          the range [posn,size()).  If posn is equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     *          size(), an empty name is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     *          if posn is outside the specified range
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    public Name getSuffix(int posn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * Determines whether this name starts with a specified prefix.
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   178
     * A name {@code n} is a prefix if it is equal to
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   179
     * {@code getPrefix(n.size())}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * @param n
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     *          the name to check
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   183
     * @return  true if {@code n} is a prefix of this name, false otherwise
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    public boolean startsWith(Name n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * Determines whether this name ends with a specified suffix.
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   189
     * A name {@code n} is a suffix if it is equal to
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   190
     * {@code getSuffix(size()-n.size())}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @param n
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     *          the name to check
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   194
     * @return  true if {@code n} is a suffix of this name, false otherwise
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    public boolean endsWith(Name n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Adds the components of a name -- in order -- to the end of this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * @param suffix
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     *          the components to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @return  the updated name (not a new one)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   205
     * @throws  InvalidNameException if {@code suffix} is not a valid name,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     *          or if the addition of the components would violate the syntax
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     *          rules of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    public Name addAll(Name suffix) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * Adds the components of a name -- in order -- at a specified position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * within this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * Components of this name at or after the index of the first new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * component are shifted up (away from 0) to accommodate the new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * @param n
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     *          the components to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     *          the index in this name at which to add the new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     *          components.  Must be in the range [0,size()].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * @return  the updated name (not a new one)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     *          if posn is outside the specified range
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   227
     * @throws  InvalidNameException if {@code n} is not a valid name,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     *          or if the addition of the components would violate the syntax
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     *          rules of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    public Name addAll(int posn, Name n) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * Adds a single component to the end of this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * @param comp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     *          the component to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * @return  the updated name (not a new one)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   240
     * @throws  InvalidNameException if adding {@code comp} would violate
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     *          the syntax rules of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    public Name add(String comp) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * Adds a single component at a specified position within this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * Components of this name at or after the index of the new component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * are shifted up by one (away from index 0) to accommodate the new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * @param comp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     *          the component to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     *          the index at which to add the new component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     *          Must be in the range [0,size()].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @return  the updated name (not a new one)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     *          if posn is outside the specified range
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   260
     * @throws  InvalidNameException if adding {@code comp} would violate
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     *          the syntax rules of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    public Name add(int posn, String comp) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * Removes a component from this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * The component of this name at the specified position is removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * Components with indexes greater than this position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * are shifted down (toward index 0) by one.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     *          the index of the component to remove.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     *          Must be in the range [0,size()).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * @return  the component removed (a String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     *          if posn is outside the specified range
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * @throws  InvalidNameException if deleting the component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     *          would violate the syntax rules of the name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    public Object remove(int posn) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
}