Package net.ggtools.grand.graph
Interface GraphObject
-
- All Known Implementing Classes:
AntLink,AntTargetNode,AntTaskLink,LinkImpl,NodeImpl,SubantTaskLink
public interface GraphObjectBase 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 voidclearAttributes(int attributeMask)Sets one or more attributes of the object.intgetAttributes()Returns a bitmask of all set attributes.GraphgetGraph()Gets the owner graph of the object.StringgetName()Gets the object's name.booleanhasAttributes(int attributeMask)Returns true if all the attributes specified by the bit mask are set.voidsetAttributes(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.
-
-