Package net.ggtools.grand.graph
Interface GraphObject
-
- 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 anint
. It is recommended that implementing classes or children interfaces define constants to represent attributes.- Author:
- Christophe Labouisse
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearAttributes(int attributeMask)
Sets one or more attributes of the object.int
getAttributes()
Returns a bitmask of all set attributes.Graph
getGraph()
Gets the owner graph of the object.String
getName()
Gets the object's name.boolean
hasAttributes(int attributeMask)
Returns true if all the attributes specified by the bit mask are set.void
setAttributes(int attributeMask)
Sets one or more attributes of the object.
-
-
-
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.
-
-