src/java.naming/share/classes/javax/naming/Name.java
author prappo
Tue, 21 Nov 2017 13:30:18 +0300
branchhttp-client-branch
changeset 55843 1e3a22efaefd
parent 47216 71c04702a3d5
child 51317 e122220d7d7e
permissions -rw-r--r--
http-client-branch: (WebSocket) cleanup. Removed not needed classes. I'll bring some of them in later, when I need them.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1999, 2004, 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.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    static final long serialVersionUID = -3617482732056931635L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * Generates a new copy of this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * Subsequent changes to the components of this name will not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * affect the new copy, and vice versa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * @return  a copy of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * @see Object#clone()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    public Object clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * Compares this name with another name for order.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * Returns a negative integer, zero, or a positive integer as this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * name is less than, equal to, or greater than the given name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    85
     * <p> As with {@code Object.equals()}, the notion of ordering for names
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * depends on the class that implements this interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * For example, the ordering may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * based on lexicographical ordering of the name components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * Specific attributes of the name, such as how it treats case,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * may affect the ordering.  In general, two names of different
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * classes may not be compared.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @param   obj the non-null object to compare against.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * @return  a negative integer, zero, or a positive integer as this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     *          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
    96
     * @throws  ClassCastException if obj is not a {@code Name} of a
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     *          type that may be compared with this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @see Comparable#compareTo(Object)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    public int compareTo(Object obj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * Returns the number of components in this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @return  the number of components in this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    public int size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * Determines whether this name is empty.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * An empty name is one with zero components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * @return  true if this name is empty, false otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    public boolean isEmpty();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * Retrieves the components of this name as an enumeration
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * of strings.  The effect on the enumeration of updates to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * this name is undefined.  If the name has zero components,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * an empty (non-null) enumeration is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * @return  an enumeration of the components of this name, each a string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    public Enumeration<String> getAll();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * Retrieves a component of this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     *          the 0-based index of the component to retrieve.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     *          Must be in the range [0,size()).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @return  the component at index posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *          if posn is outside the specified range
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    public String get(int posn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * Creates a name whose components consist of a prefix of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * components of this name.  Subsequent changes to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * this name will not affect the name that is returned and vice versa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     *          the 0-based index of the component at which to stop.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     *          Must be in the range [0,size()].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @return  a name consisting of the components at indexes in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     *          the range [0,posn).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     *          if posn is outside the specified range
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    public Name getPrefix(int posn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * Creates a name whose components consist of a suffix of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * components in this name.  Subsequent changes to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * this name do not affect the name that is returned and vice versa.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     *          the 0-based index of the component at which to start.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     *          Must be in the range [0,size()].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * @return  a name consisting of the components at indexes in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     *          the range [posn,size()).  If posn is equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     *          size(), an empty name is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     *          if posn is outside the specified range
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    public Name getSuffix(int posn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * 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
   173
     * 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
   174
     * {@code getPrefix(n.size())}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * @param n
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     *          the name to check
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   178
     * @return  true if {@code n} is a prefix of this name, false otherwise
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    public boolean startsWith(Name n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * 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
   184
     * 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
   185
     * {@code getSuffix(size()-n.size())}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * @param n
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     *          the name to check
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   189
     * @return  true if {@code n} is a suffix of this name, false otherwise
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    public boolean endsWith(Name n);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * Adds the components of a name -- in order -- to the end of this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * @param suffix
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     *          the components to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * @return  the updated name (not a new one)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   200
     * @throws  InvalidNameException if {@code suffix} is not a valid name,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     *          or if the addition of the components would violate the syntax
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     *          rules of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    public Name addAll(Name suffix) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * Adds the components of a name -- in order -- at a specified position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * within this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * Components of this name at or after the index of the first new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * component are shifted up (away from 0) to accommodate the new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * @param n
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     *          the components to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     *          the index in this name at which to add the new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     *          components.  Must be in the range [0,size()].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * @return  the updated name (not a new one)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     *          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
   222
     * @throws  InvalidNameException if {@code n} is not a valid name,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     *          or if the addition of the components would violate the syntax
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     *          rules of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    public Name addAll(int posn, Name n) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * Adds a single component to the end of this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @param comp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     *          the component to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * @return  the updated name (not a new one)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   235
     * @throws  InvalidNameException if adding {@code comp} would violate
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     *          the syntax rules of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    public Name add(String comp) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * Adds a single component at a specified position within this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * Components of this name at or after the index of the new component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * are shifted up by one (away from index 0) to accommodate the new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * @param comp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     *          the component to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     *          the index at which to add the new component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     *          Must be in the range [0,size()].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * @return  the updated name (not a new one)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     *          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
   255
     * @throws  InvalidNameException if adding {@code comp} would violate
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     *          the syntax rules of this name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    public Name add(int posn, String comp) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * Removes a component from this name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * The component of this name at the specified position is removed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * Components with indexes greater than this position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * are shifted down (toward index 0) by one.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * @param posn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     *          the index of the component to remove.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     *          Must be in the range [0,size()).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * @return  the component removed (a String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * @throws  ArrayIndexOutOfBoundsException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     *          if posn is outside the specified range
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * @throws  InvalidNameException if deleting the component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     *          would violate the syntax rules of the name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    public Object remove(int posn) throws InvalidNameException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
}