Search this API

y.layout.router
Class BusDescriptor

java.lang.Object
  extended by y.layout.router.BusDescriptor

public class BusDescriptor
extends java.lang.Object

A descriptor for bus-related information to be associated with an edge.

It consists of a bus ID defining the bus of the associated edge, two optional edge group IDs for specifying the edge grouping at the source and target side, respectively, and an optional boolean flag to mark the edge as fixed.

Every object except null can be used as a valid bus ID. Every edge of ID null forms a group of its own. Also, every object except null can be used as a valid edge group ID. If there is no group ID defined for an edge or if null is set, a default group ID is used. Therefore, all such edges ending at the same node belong to the same group.

 
At least one of the edges of a bus has to connect two different nodes. Otherwise, if all edges are self-loops (edges that start and end at the same node), the edges are routed separately without constituting a bus structure.
See Also:
BusRouter.EDGE_DESCRIPTOR_DPKEY
 

Constructor Summary
BusDescriptor(java.lang.Object busID)
          Creates a new instance of BusDescriptor for the specified bus ID which is marked as not fixed and uses the default edge group IDs.
BusDescriptor(java.lang.Object busID, boolean fixed)
          Creates a new instance of BusDescriptor for the specified parameters and default group IDs.
BusDescriptor(java.lang.Object busID, boolean fixed, java.lang.Object sourceGroupID, java.lang.Object targetGroupID)
          Creates a new instance of BusDescriptor for the specified parameters.
BusDescriptor(java.lang.Object busID, java.lang.Object sourceGroupID, java.lang.Object targetGroupID)
          Creates a new instance of BusDescriptor for the specified parameters and marks it as not fixed.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether or not some other object is "equal to" this one.
 java.lang.Object getID()
          Returns the bus ID.
 java.lang.Object getSourceGroupID()
          Returns the group ID for the source side of the edge.
 java.lang.Object getTargetGroupID()
          Returns the group ID for the target side of the edge.
 int hashCode()
          Returns a hash code value for this BusDescriptor instance.
 boolean isFixed()
          Returns whether or not the associated edge is fixed.
 void setFixed(boolean fixed)
          Specifies whether or not the associated edge is fixed.
 void setID(java.lang.Object busID)
          Specifies the bus ID.
 void setSourceGroupID(java.lang.Object sourceGroupID)
          Specifies the new group ID for the source side of the edge.
 void setTargetGroupID(java.lang.Object targetGroupID)
          Specifies the new group ID for the target side of the edge.
 java.lang.String toString()
          Returns a string representation consisting of the bus ID, the fixed flag, and both group IDs.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BusDescriptor

public BusDescriptor(java.lang.Object busID)
Creates a new instance of BusDescriptor for the specified bus ID which is marked as not fixed and uses the default edge group IDs.

Parameters:
busID - the ID of the bus to which the associated edge belongs

BusDescriptor

public BusDescriptor(java.lang.Object busID,
                     java.lang.Object sourceGroupID,
                     java.lang.Object targetGroupID)
Creates a new instance of BusDescriptor for the specified parameters and marks it as not fixed.

Parameters:
busID - the ID of the bus to which the associated edge belongs
sourceGroupID - the group ID of the source side
targetGroupID - the group ID of the target side

BusDescriptor

public BusDescriptor(java.lang.Object busID,
                     boolean fixed)
Creates a new instance of BusDescriptor for the specified parameters and default group IDs.

Parameters:
busID - the ID of the bus to which the associated edge belongs
fixed - true if associated edge is fixed, false otherwise

BusDescriptor

public BusDescriptor(java.lang.Object busID,
                     boolean fixed,
                     java.lang.Object sourceGroupID,
                     java.lang.Object targetGroupID)
Creates a new instance of BusDescriptor for the specified parameters.

Parameters:
busID - the ID of the bus to which the associated edge belongs
fixed - true if associated edge is fixed, false otherwise
sourceGroupID - the group ID of the source side
targetGroupID - the group ID of the target side
Method Detail

equals

public boolean equals(java.lang.Object obj)
Indicates whether or not some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare
Returns:
true if all corresponding parameters are equal, false otherwise

hashCode

public int hashCode()
Returns a hash code value for this BusDescriptor instance.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value

getID

public java.lang.Object getID()
Returns the bus ID.

Edges associated with descriptor instances having the same bus ID belong to a common bus. Every edge associated with ID null forms a group of its own.

Returns:
the bus ID

setID

public void setID(java.lang.Object busID)
Specifies the bus ID.

Edges associated with descriptor instances having the same bus ID belong to a common bus. Every edge associated with ID null forms a group of its own.

Parameters:
busID - the bus ID

getSourceGroupID

public java.lang.Object getSourceGroupID()
Returns the group ID for the source side of the edge.

Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections at v.

Returns:
the group ID for the source side

setSourceGroupID

public void setSourceGroupID(java.lang.Object sourceGroupID)
Specifies the new group ID for the source side of the edge.

Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections at v.

 
If there is no group ID defined or if null is set, a default group ID is used. Therefore, all associated edges ending at the same node belong to the same group.
Default Value:
The default value is Object. All associated edges ending at the same node belong to the same group (unless otherwise specified in the constructor).
Parameters:
sourceGroupID - the group ID to set

getTargetGroupID

public java.lang.Object getTargetGroupID()
Returns the group ID for the target side of the edge.

Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections at v.

Returns:
the group ID for the target side

setTargetGroupID

public void setTargetGroupID(java.lang.Object targetGroupID)
Specifies the new group ID for the target side of the edge.

Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections at v.

 
If there is no group ID defined or if null is set, a default group ID is used. Therefore, all associated edges ending at the same node belong to the same group.
Default Value:
The default value is Object. All associated edges ending at the same node belong to the same group (unless otherwise specified in the constructor).
Parameters:
targetGroupID - the group ID to set

isFixed

public boolean isFixed()
Returns whether or not the associated edge is fixed.

The algorithm doesn't change the route of fixed edges but tries to prevent overlaps with non-fixed edges.

 
The structure induced by the fixed edges must be orthogonal and cycle-free.
Returns:
true if the associated edge is fixed, false otherwise

setFixed

public void setFixed(boolean fixed)
Specifies whether or not the associated edge is fixed.

The algorithm doesn't change the route of fixed edges but tries to prevent overlaps with non-fixed edges.

 
The structure induced by the fixed edges must be orthogonal and cycle-free.
Default Value:
The default value is false. The associated edge is not fixed (unless otherwise specified in the constructor).
Parameters:
fixed - true if the associated edge should be fixed, false otherwise

toString

public java.lang.String toString()
Returns a string representation consisting of the bus ID, the fixed flag, and both group IDs.

Overrides:
toString in class java.lang.Object
Returns:
a string representation consisting of the bus ID, the fixed flag, and both group IDs

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.