< prev index next >

src/java.naming/share/classes/javax/naming/Name.java

Print this page

        

*** 26,41 **** package javax.naming; import java.util.Enumeration; /** ! * The <tt>Name</tt> 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). * ! * <p> There can be different implementations of <tt>Name</tt>; for example, * composite names, URLs, or namespace-specific compound names. * * <p> 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). --- 26,41 ---- package javax.naming; import java.util.Enumeration; /** ! * The {@code 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). * ! * <p> There can be different implementations of {@code Name}; for example, * composite names, URLs, or namespace-specific compound names. * * <p> 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).
*** 44,54 **** * * <p> 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. * ! * <p> An instance of a <tt>Name</tt> may not be synchronized against * concurrent multithreaded access if that access is not read-only. * * @author Rosanna Lee * @author Scott Seligman * @author R. Vasudevan --- 44,54 ---- * * <p> 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. * ! * <p> An instance of a {@code Name} may not be synchronized against * concurrent multithreaded access if that access is not read-only. * * @author Rosanna Lee * @author Scott Seligman * @author R. Vasudevan
*** 80,101 **** /** * Compares this name with another name for order. * Returns a negative integer, zero, or a positive integer as this * name is less than, equal to, or greater than the given name. * ! * <p> As with <tt>Object.equals()</tt>, the notion of ordering for names * depends on the class that implements this interface. * For example, the ordering may be * based on lexicographical ordering of the name components. * Specific attributes of the name, such as how it treats case, * may affect the ordering. In general, two names of different * classes may not be compared. * * @param obj the non-null object to compare against. * @return a negative integer, zero, or a positive integer as this name * is less than, equal to, or greater than the given name ! * @throws ClassCastException if obj is not a <tt>Name</tt> of a * type that may be compared with this name * * @see Comparable#compareTo(Object) */ public int compareTo(Object obj); --- 80,101 ---- /** * Compares this name with another name for order. * Returns a negative integer, zero, or a positive integer as this * name is less than, equal to, or greater than the given name. * ! * <p> As with {@code Object.equals()}, the notion of ordering for names * depends on the class that implements this interface. * For example, the ordering may be * based on lexicographical ordering of the name components. * Specific attributes of the name, such as how it treats case, * may affect the ordering. In general, two names of different * classes may not be compared. * * @param obj the non-null object to compare against. * @return a negative integer, zero, or a positive integer as this name * is less than, equal to, or greater than the given name ! * @throws ClassCastException if obj is not a {@code Name} of a * type that may be compared with this name * * @see Comparable#compareTo(Object) */ public int compareTo(Object obj);
*** 168,205 **** */ public Name getSuffix(int posn); /** * Determines whether this name starts with a specified prefix. ! * A name <tt>n</tt> is a prefix if it is equal to ! * <tt>getPrefix(n.size())</tt>. * * @param n * the name to check ! * @return true if <tt>n</tt> is a prefix of this name, false otherwise */ public boolean startsWith(Name n); /** * Determines whether this name ends with a specified suffix. ! * A name <tt>n</tt> is a suffix if it is equal to ! * <tt>getSuffix(size()-n.size())</tt>. * * @param n * the name to check ! * @return true if <tt>n</tt> is a suffix of this name, false otherwise */ public boolean endsWith(Name n); /** * Adds the components of a name -- in order -- to the end of this name. * * @param suffix * the components to add * @return the updated name (not a new one) * ! * @throws InvalidNameException if <tt>suffix</tt> is not a valid name, * or if the addition of the components would violate the syntax * rules of this name */ public Name addAll(Name suffix) throws InvalidNameException; --- 168,205 ---- */ public Name getSuffix(int posn); /** * Determines whether this name starts with a specified prefix. ! * A name {@code n} is a prefix if it is equal to ! * {@code getPrefix(n.size())}. * * @param n * the name to check ! * @return true if {@code n} is a prefix of this name, false otherwise */ public boolean startsWith(Name n); /** * Determines whether this name ends with a specified suffix. ! * A name {@code n} is a suffix if it is equal to ! * {@code getSuffix(size()-n.size())}. * * @param n * the name to check ! * @return true if {@code n} is a suffix of this name, false otherwise */ public boolean endsWith(Name n); /** * Adds the components of a name -- in order -- to the end of this name. * * @param suffix * the components to add * @return the updated name (not a new one) * ! * @throws InvalidNameException if {@code suffix} is not a valid name, * or if the addition of the components would violate the syntax * rules of this name */ public Name addAll(Name suffix) throws InvalidNameException;
*** 217,227 **** * components. Must be in the range [0,size()]. * @return the updated name (not a new one) * * @throws ArrayIndexOutOfBoundsException * if posn is outside the specified range ! * @throws InvalidNameException if <tt>n</tt> is not a valid name, * or if the addition of the components would violate the syntax * rules of this name */ public Name addAll(int posn, Name n) throws InvalidNameException; --- 217,227 ---- * components. Must be in the range [0,size()]. * @return the updated name (not a new one) * * @throws ArrayIndexOutOfBoundsException * if posn is outside the specified range ! * @throws InvalidNameException if {@code n} is not a valid name, * or if the addition of the components would violate the syntax * rules of this name */ public Name addAll(int posn, Name n) throws InvalidNameException;
*** 230,240 **** * * @param comp * the component to add * @return the updated name (not a new one) * ! * @throws InvalidNameException if adding <tt>comp</tt> would violate * the syntax rules of this name */ public Name add(String comp) throws InvalidNameException; /** --- 230,240 ---- * * @param comp * the component to add * @return the updated name (not a new one) * ! * @throws InvalidNameException if adding {@code comp} would violate * the syntax rules of this name */ public Name add(String comp) throws InvalidNameException; /**
*** 250,260 **** * Must be in the range [0,size()]. * @return the updated name (not a new one) * * @throws ArrayIndexOutOfBoundsException * if posn is outside the specified range ! * @throws InvalidNameException if adding <tt>comp</tt> would violate * the syntax rules of this name */ public Name add(int posn, String comp) throws InvalidNameException; /** --- 250,260 ---- * Must be in the range [0,size()]. * @return the updated name (not a new one) * * @throws ArrayIndexOutOfBoundsException * if posn is outside the specified range ! * @throws InvalidNameException if adding {@code comp} would violate * the syntax rules of this name */ public Name add(int posn, String comp) throws InvalidNameException; /**
< prev index next >