|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Name
This interface is responsible for managing the names for all the base objects.
Examples of name are "http://tpaconseil.com", "c:\program files\access road", "net/users/john". The separator character depends on the ACS.
Name follows the OMG CORBA Object Services Specification (OMG-COSS) for a naming service which names an object for later retrieval. Methods added to the OMG specification are extended(ImmutableName), extended(String), clone(), equals(), hashCode(), getSerialVersion(), getNameFromString(). It does NOT follow the JNDI name interface.
The name is an ordered list of components in a java.util.ArrayList. Each component is a string that may be null. Case must be respected. ':: ' is a forbidden component, because it is used in toString() and getNameFromString(). It is controlled in every creating or updating method.
The usual struture of an entity name is (IS name).(ACS name).(entity name) Normally, the usual name of an instance of Name is equals to name.lastComponent().
This interface extends ImmutableName that contains all the get methods and the equivalent ones (clone(), equals()...).
To remove any component, use without(). To add a component at the end, use extended(). To modify the last component, use without() then extended(). For more complex modifying operations, use the list returned by components(). With threads, always call these methods in a block synchronized on the Name instance.
If the name is used as a key in a map, it is much safer to avoid a mutable name. Use then the ImmutableName interface to construct the key. But the update will remain possible by casting the ImmutableName in Name.
Method Summary | |
---|---|
Name |
extended(ImmutableName _name)
For extending the current name. |
Name |
extended(java.lang.String _nc)
For extending the current name. |
Name |
subname(int _start,
int _end)
Returns a new independant Name instance as an extract of the current Name. |
Name |
without(Name _name)
|
Methods inherited from interface ARoad0.gBaseInterface.ImmutableName |
---|
clone, compareTo, component, components, contains, context, context, equals, getSerialVersionUID, hashCode, immutableComponents, isEmpty, lastComponent, noOfComponents |
Method Detail |
---|
Name without(Name _name)
_name
- is removed from the current name. _name may be at the start,
the end or the middle of the current name.
If there are several sections of the current name that are strictly
identical to _name, without() removes the last matched part,
at the end of the current name.
Name extended(java.lang.String _nc)
_nc
- adds a new last component to the current instance. The string
added is not backed by the argument, so modify the new component
doesn't modify the initial string used as argument in this method.
With threads, this method must be used in a synchronized block
Name extended(ImmutableName _name)
_name
- adds a new name at the end of the current instance,
with string components.
Name subname(int _start, int _end)
subname
in interface ImmutableName
_start
- inclusive fromIndex_end
- exclusive toIndex
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |