Package jadex.bridge

Class ComponentIdentifier

  • All Implemented Interfaces:
    IComponentIdentifier, java.io.Serializable, java.lang.Cloneable

    public class ComponentIdentifier
    extends java.lang.Object
    implements IComponentIdentifier, java.lang.Cloneable, java.io.Serializable
    A component identifier. Name is unique and has the form
    See Also:
    Serialized Form
    • Field Detail

      • name

        protected java.lang.String name
        The component name.
      • root

        protected java.lang.String root
        Cache for platform name for getRoot() calls.
    • Constructor Detail

      • ComponentIdentifier

        public ComponentIdentifier()
        Create a new component identifier. Bean constructor
      • ComponentIdentifier

        public ComponentIdentifier​(java.lang.String name)
        Create a new component identifier with a global name and given addresses.
        Parameters:
        name - A global name (e.g. "cms@lars").
      • ComponentIdentifier

        public ComponentIdentifier​(java.lang.String name,
                                   IComponentIdentifier parent)
        Create component identifier.
        Parameters:
        name - The local name.
        parent - The parent.
        addresses - The addresses.
      • ComponentIdentifier

        public ComponentIdentifier​(IComponentIdentifier cid)
        Copy a component identifier.
        Parameters:
        cid - The id to copy from.
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the component name.
        Specified by:
        getName in interface IComponentIdentifier
        Returns:
        The name of an component.
      • setName

        public void setName​(java.lang.String name)
        Set the component name.
        Parameters:
        name - The component name.
      • clone

        public java.lang.Object clone()
        Clone this component identifier. Does a deep copy.
        Overrides:
        clone in class java.lang.Object
      • getPlatformName

        public java.lang.String getPlatformName()
        Get the platform name.
        Specified by:
        getPlatformName in interface IComponentIdentifier
        Returns:
        The platform name.
      • getDotName

        public java.lang.String getDotName()
        Get the name without @ replaced by dot.
        Specified by:
        getDotName in interface IComponentIdentifier
        Returns:
        The dot name.
      • hasSameRoot

        public boolean hasSameRoot​(IComponentIdentifier cid)
        Test if this identifier has the same root as the cid.
        Specified by:
        hasSameRoot in interface IComponentIdentifier
        Parameters:
        cid - The component id.
        Returns:
        True, if the root is equal.
      • getPlatformPrefix

        public java.lang.String getPlatformPrefix()
        Get the platform name without the suffix for name uniqueness.
        Specified by:
        getPlatformPrefix in interface IComponentIdentifier
        Returns:
        The platform name without suffix.
      • hashCode

        public int hashCode()
        The hash code of the object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hashcode.
      • equals

        public boolean equals​(java.lang.Object obj)
        Test if two component identifiers are equal.
        Overrides:
        equals in class java.lang.Object
        Returns:
        True, if equal.
      • toString

        public java.lang.String toString()
        Return a string representation.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.
      • getPlatformPrefix

        public static java.lang.String getPlatformPrefix​(java.lang.String name)
        Get the stripped platform name.
        Parameters:
        name - The platform name.
        Returns:
        the stripped platform name.