Package com.alexmerz.graphviz.objects
Class Id
- java.lang.Object
-
- com.alexmerz.graphviz.objects.Id
-
public class Id extends Object
This object is used to identify graphs and nodes Note, that an object may contain an id or a label.
-
-
Constructor Summary
Constructors Constructor Description Id()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId()Returns the Id of the object Empty string means, that this object has no Id.StringgetLabel()Returns the label of the objectbooleanisEqual(Id eid)Compares the Ids.voidsetId(String id)Sets the object id.voidsetLabel(String label)Sets the label of the objectStringtoString()Returns the String representation of this Id
-
-
-
Method Detail
-
getId
public String getId()
Returns the Id of the object Empty string means, that this object has no Id.- Returns:
- the object id
-
setId
public void setId(String id)
Sets the object id. An empty string deletes the Id.- Parameters:
id-
-
getLabel
public String getLabel()
Returns the label of the object- Returns:
- the object label
-
setLabel
public void setLabel(String label)
Sets the label of the object- Parameters:
label-
-
toString
public String toString()
Returns the String representation of this Id
-
isEqual
public boolean isEqual(Id eid)
Compares the Ids. Two Id objects are equal, if- both are the same, or
- Id and Label attribute are equal
- both ids are empty and the labels are equal
- Parameters:
eid-- Returns:
- true if both Ids are equal
-
-