*/
public TmfEdge linkHorizontal(TmfVertex to) {
checkTimestamps(to);
+ checkNotSelf(to);
return linkHorizontalRaw(to);
}
*/
public TmfEdge linkVertical(TmfVertex to) {
checkTimestamps(to);
+ checkNotSelf(to);
return linkVerticalRaw(to);
}
}
}
+ private void checkNotSelf(TmfVertex to) {
+ if (this == to) {
+ throw new IllegalArgumentException(Messages.TmfVertex_CannotLinkToSelf);
+ }
+ }
+
+
/**
* Get an edge to or from this vertex in the appropriate direction
*