org.objectweb.mobilitools.smi.api
Class Name

java.lang.Object
  |
  +--org.objectweb.mobilitools.smi.api.Name
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class Name
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

MobiliTools $Name: $, $Id: Name.java,v 1.1.1.1 2003/03/28 14:48:06 dillense Exp $

Wrapper class for MAF's Name class. Uniquely identies an agent or an agency.

See Also:
Serialized Form

Constructor Summary
Name(byte[] authority, byte[] identity, short type)
          Creates a new Name object from the given authority, identity and agent system type identifier.
Name(Name name)
          Duplicates a Name.
Name(org.omg.CfMAF.Name name)
          Creates a new Name object from a MAF name (IDL-defined type).
Name(java.lang.String str)
          Creates a new Name from a string representation of a MAF name.
Name(java.lang.String authority, java.lang.String identity, short type)
          Creates a new Name object from the given authority and identity in string representation, and agent system type identifier.
 
Method Summary
 java.lang.String authority()
           
 int compareTo(java.lang.Object other)
           
 boolean equals(java.lang.Object other)
           
 org.omg.CfMAF.Name getmafname()
           
 java.lang.String getStringRepresentation()
           
 int hashCode()
           
 java.lang.String identity()
           
 java.lang.String toString()
           
 short type()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Name

public Name(Name name)
Duplicates a Name.
Parameters:
name - the name to duplicate

Name

public Name(org.omg.CfMAF.Name name)
Creates a new Name object from a MAF name (IDL-defined type).
Parameters:
name - the MAF representation of the name to duplicate

Name

public Name(byte[] authority,
            byte[] identity,
            short type)
Creates a new Name object from the given authority, identity and agent system type identifier.
Parameters:
authority - the authority of the agent or agency designated byt the new name
identity - the identity of the agent or agency designated by the new name
type - the agenct system type of the agent or agency designated by the new name

Name

public Name(java.lang.String authority,
            java.lang.String identity,
            short type)
Creates a new Name object from the given authority and identity in string representation, and agent system type identifier.
Parameters:
authority - the authority of the agent or agency designated byt the new name
identity - the identity of the agent or agency designated by the new name
type - the agent system type of the agent or agency designated by the new name

Name

public Name(java.lang.String str)
Creates a new Name from a string representation of a MAF name.
See Also:
getStringRepresentation()
Method Detail

getmafname

public org.omg.CfMAF.Name getmafname()
Returns:
the MAF name (IDL-defined type).

identity

public java.lang.String identity()
Returns:
a string representation of the agent idendity.

authority

public java.lang.String authority()
Returns:
a string representation of the agent's authority.

type

public short type()
Returns:
the agent system type Id

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a printable string (partial) representation of the name using format "identity (authority)".

getStringRepresentation

public java.lang.String getStringRepresentation()
Returns:
a string-coded full representation of the MAF name (not printable).

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(java.lang.Object other)
Specified by:
compareTo in interface java.lang.Comparable