Java Doc for Name.java in  » 6.0-JDK-Core » naming » javax » naming » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » naming » javax.naming 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.naming.Name

All known Subclasses:   javax.naming.ldap.LdapName,  javax.naming.CompoundName,  javax.naming.CompositeName,
Name
public interface Name extends Cloneable,java.io.Serializable,Comparable<Object>(Code)
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.
author:
   Rosanna Lee
author:
   Scott Seligman
author:
   R. Vasudevan
version:
   1.18 07/05/05
since:
   1.3



Field Summary
final static  longserialVersionUID
     The class fingerprint that is set to indicate serialization compatibility with a previous version of the class.


Method Summary
public  Nameadd(String comp)
     Adds a single component to the end of this name.
public  Nameadd(int posn, String comp)
     Adds a single component at a specified position within this name.
public  NameaddAll(Name suffix)
     Adds the components of a name -- in order -- to the end of this name.
public  NameaddAll(int posn, Name n)
     Adds the components of a name -- in order -- at a specified position within this name. Components of this name at or after the index of the first new component are shifted up (away from 0) to accommodate the new components.
Parameters:
  n - the components to add
Parameters:
  posn - the index in this name at which to add the newcomponents.
public  Objectclone()
     Generates a new copy of this name.
public  intcompareTo(Object obj)
     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.

As with 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.

public  booleanendsWith(Name n)
     Determines whether this name ends with a specified suffix.
public  Stringget(int posn)
     Retrieves a component of this name.
public  Enumeration<String>getAll()
     Retrieves the components of this name as an enumeration of strings.
public  NamegetPrefix(int posn)
     Creates a name whose components consist of a prefix of the components of this name.
public  NamegetSuffix(int posn)
     Creates a name whose components consist of a suffix of the components in this name.
public  booleanisEmpty()
     Determines whether this name is empty.
public  Objectremove(int posn)
     Removes a component from this name.
public  intsize()
     Returns the number of components in this name.
public  booleanstartsWith(Name n)
     Determines whether this name starts with a specified prefix.

Field Detail
serialVersionUID
final static long serialVersionUID(Code)
The class fingerprint that is set to indicate serialization compatibility with a previous version of the class.





Method Detail
add
public Name add(String comp) throws InvalidNameException(Code)
Adds a single component to the end of this name.
Parameters:
  comp - the component to add the updated name (not a new one)
throws:
  InvalidNameException - if adding comp would violatethe syntax rules of this name



add
public Name add(int posn, String comp) throws InvalidNameException(Code)
Adds a single component at a specified position within this name. Components of this name at or after the index of the new component are shifted up by one (away from index 0) to accommodate the new component.
Parameters:
  comp - the component to add
Parameters:
  posn - the index at which to add the new component.Must be in the range [0,size()]. the updated name (not a new one)
throws:
  ArrayIndexOutOfBoundsException - if posn is outside the specified range
throws:
  InvalidNameException - if adding comp would violatethe syntax rules of this name



addAll
public Name addAll(Name suffix) throws InvalidNameException(Code)
Adds the components of a name -- in order -- to the end of this name.
Parameters:
  suffix - the components to add the updated name (not a new one)
throws:
  InvalidNameException - if suffix is not a valid name,or if the addition of the components would violate the syntaxrules of this name



addAll
public Name addAll(int posn, Name n) throws InvalidNameException(Code)
Adds the components of a name -- in order -- at a specified position within this name. Components of this name at or after the index of the first new component are shifted up (away from 0) to accommodate the new components.
Parameters:
  n - the components to add
Parameters:
  posn - the index in this name at which to add the newcomponents. Must be in the range [0,size()]. the updated name (not a new one)
throws:
  ArrayIndexOutOfBoundsException - if posn is outside the specified range
throws:
  InvalidNameException - if n is not a valid name,or if the addition of the components would violate the syntaxrules of this name



clone
public Object clone()(Code)
Generates a new copy of this name. Subsequent changes to the components of this name will not affect the new copy, and vice versa. a copy of this name
See Also:   Object.clone



compareTo
public int compareTo(Object obj)(Code)
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.

As with 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.
Parameters:
  obj - the non-null object to compare against. a negative integer, zero, or a positive integer as this nameis less than, equal to, or greater than the given name
throws:
  ClassCastException - if obj is not a Name of atype that may be compared with this name
See Also:   Comparable.compareTo(Object)




endsWith
public boolean endsWith(Name n)(Code)
Determines whether this name ends with a specified suffix. A name n is a suffix if it is equal to getSuffix(size()-n.size()).
Parameters:
  n - the name to check true if n is a suffix of this name, false otherwise



get
public String get(int posn)(Code)
Retrieves a component of this name.
Parameters:
  posn - the 0-based index of the component to retrieve.Must be in the range [0,size()). the component at index posn
throws:
  ArrayIndexOutOfBoundsException - if posn is outside the specified range



getAll
public Enumeration<String> getAll()(Code)
Retrieves the components of this name as an enumeration of strings. The effect on the enumeration of updates to this name is undefined. If the name has zero components, an empty (non-null) enumeration is returned. an enumeration of the components of this name, each a string



getPrefix
public Name getPrefix(int posn)(Code)
Creates a name whose components consist of a prefix of the components of this name. Subsequent changes to this name will not affect the name that is returned and vice versa.
Parameters:
  posn - the 0-based index of the component at which to stop.Must be in the range [0,size()]. a name consisting of the components at indexes inthe range [0,posn).
throws:
  ArrayIndexOutOfBoundsException - if posn is outside the specified range



getSuffix
public Name getSuffix(int posn)(Code)
Creates a name whose components consist of a suffix of the components in this name. Subsequent changes to this name do not affect the name that is returned and vice versa.
Parameters:
  posn - the 0-based index of the component at which to start.Must be in the range [0,size()]. a name consisting of the components at indexes inthe range [posn,size()). If posn is equal to size(), an empty name is returned.
throws:
  ArrayIndexOutOfBoundsException - if posn is outside the specified range



isEmpty
public boolean isEmpty()(Code)
Determines whether this name is empty. An empty name is one with zero components. true if this name is empty, false otherwise



remove
public Object remove(int posn) throws InvalidNameException(Code)
Removes a component from this name. The component of this name at the specified position is removed. Components with indexes greater than this position are shifted down (toward index 0) by one.
Parameters:
  posn - the index of the component to remove.Must be in the range [0,size()). the component removed (a String)
throws:
  ArrayIndexOutOfBoundsException - if posn is outside the specified range
throws:
  InvalidNameException - if deleting the componentwould violate the syntax rules of the name



size
public int size()(Code)
Returns the number of components in this name. the number of components in this name



startsWith
public boolean startsWith(Name n)(Code)
Determines whether this name starts with a specified prefix. A name n is a prefix if it is equal to getPrefix(n.size()).
Parameters:
  n - the name to check true if n is a prefix of this name, false otherwise



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.