Interface GraphObject

  • All Known Subinterfaces:
    Link, Node
    All Known Implementing Classes:
    AntLink, AntTargetNode, AntTaskLink, LinkImpl, NodeImpl, SubantTaskLink

    public interface GraphObject
    Base for objects populating graphs. GraphObjects have three main traits: a name, a owner graph and attributes. Attributes should be implemented by setting or clearing a bit(s) in an int. It is recommended that implementing classes or children interfaces define constants to represent attributes.
    Author:
    Christophe Labouisse
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ATTR_ALL
      An attribute mask representing all attributes.
      static int ATTR_NONE
      An attribute mask representing no attribute.
    • Field Detail

      • ATTR_ALL

        static final int ATTR_ALL
        An attribute mask representing all attributes.
        See Also:
        Constant Field Values
      • ATTR_NONE

        static final int ATTR_NONE
        An attribute mask representing no attribute.
        See Also:
        Constant Field Values
    • Method Detail

      • getGraph

        Graph getGraph()
        Gets the owner graph of the object.
        Returns:
        the owning graph.
      • getName

        String getName()
        Gets the object's name.
        Returns:
        object's name.
      • setAttributes

        void setAttributes​(int attributeMask)
        Sets one or more attributes of the object. Multiple attributes should be combined by oring individual attributes: setAttributes(ATTR_ONE | ATTR_TWO);
        Parameters:
        attributeMask - a bit mask of attributes to set.
      • getAttributes

        int getAttributes()
        Returns a bitmask of all set attributes.
        Returns:
        object's attributes.
      • clearAttributes

        void clearAttributes​(int attributeMask)
        Sets one or more attributes of the object. Multiple attributes should be combined by oring individual attributes: clearAttributes(ATTR_ONE | ATTR_TWO);
        Parameters:
        attributeMask - a bit mask of attributes to clean.
      • hasAttributes

        boolean hasAttributes​(int attributeMask)
        Returns true if all the attributes specified by the bit mask are set.
        Parameters:
        attributeMask - a bit mask of attributes to test.
        Returns:
        true if all attributes are set.