Class ActorPath

    • Field Detail

      • m_Parts

        protected String[] m_Parts
        the elements of the path.
      • m_FullPath

        protected String m_FullPath
        the full path.
    • Constructor Detail

      • ActorPath

        public ActorPath()
        Initializes the path.
      • ActorPath

        public ActorPath​(String path)
        Initializes the path.
        Parameters:
        path - the path to break up
      • ActorPath

        public ActorPath​(String[] path)
        Initializes the path with the specified elements.
        Parameters:
        path - the path elements to use
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Returns whether the path is empty or not.
        Returns:
        true if empty
      • getPath

        public String[] getPath()
        Returns a clone of the path elements.
        Returns:
        the elements of the path
      • getPathCount

        public int getPathCount()
        Returns the number of path elements this path is made of.
        Returns:
        the number of path elements
      • getPathComponent

        public String getPathComponent​(int element)
        Returns the specified element of the path.
        Parameters:
        element - the index of the element to retrieve
        Returns:
        the specified path element
      • getParentPath

        public ActorPath getParentPath()
        Returns the path without the last element.
        Returns:
        the new path
      • getChildPath

        public ActorPath getChildPath()
        Returns the path without the first element.
        Returns:
        the new path
      • getLastPathComponent

        public String getLastPathComponent()
        Returns the last path component, if available.
        Returns:
        the last component, null if no path elements stored
      • getFirstPathComponent

        public String getFirstPathComponent()
        Returns the first path component, if available.
        Returns:
        the first component, null if no path elements stored
      • isDescendant

        public boolean isDescendant​(ActorPath actorPath)
        Checks whether the specified actor path is a descendant of this actor path object. A path is always a descendant of itself. [a, b, c] is a descendant of [a, b] and so is [a, b], but not [a].
        Parameters:
        actorPath - the path to check whether it is a descendant
        Returns:
        true if a descendant
      • getCommonAncestor

        public ActorPath getCommonAncestor​(ActorPath actorPath)
        Returns the path that denotes the common ancestor of this and the specified actor path.
        Parameters:
        actorPath - the actor path to get the common ancestor for
        Returns:
        the common ancestor (can have length 0!)
      • compareTo

        public int compareTo​(ActorPath o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Specified by:
        compareTo in interface Comparable<ActorPath>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Checks whether the provided object is the same as this one.
        Overrides:
        equals in class Object
        Returns:
        true if the object is an ActorPath and represents the same path elements
      • hashCode

        public int hashCode()
        Returns the hashcode of the underlying array.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode
      • toString

        public String toString()
        Returns the path as a single string.
        Overrides:
        toString in class Object
        Returns:
        the complete path