|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmapss.dif.graph.hierarchy.Port
public class Port
Port class for interfacing of hierarchy objects with other hierarchies.
Inside a hierarchy, A Port of this hierarchy can relate to a single Node or relate to a port of a super node inside this hierarchy. We use "relate" to associate node inside a hierarchy.
A port A connect to a port B (B in higher hierarchy), which means B relate to A.
We restrict that a port can connect to either single edge or a single port in higher hierarchy, but not both. We use "connect" to associate edges or a port outside a hierarchy.
For more information about how to use this class refer to the package documentation.
Graph
Field Summary | |
---|---|
static int |
IN
Indicates that a port is an input port. |
static int |
INOUT
Indicates that a port is a bi-directional port. |
static int |
OUT
Indicates that a port is an output port. |
Constructor Summary | |
---|---|
Port(java.lang.String name,
Hierarchy hierarchy)
Construct an undirected port. |
|
Port(java.lang.String name,
Hierarchy hierarchy,
int direction)
Construct a directed port. |
Method Summary | |
---|---|
java.lang.Object |
connect(mocgraph.Edge edge)
Connect a port to an edge. |
java.lang.Object |
connect(Port port)
Connect a port to another port. |
java.lang.Object |
disconnect()
Disconnects a port from its edge or super-port. |
void |
dispose()
Disposes an unconnected port. |
java.lang.Object |
getConnection()
Returns the edge or port connected to this port. |
int |
getDirection()
Returns the direction of a port. |
Hierarchy |
getHierarchy()
Returns the hierarchy that this port belongs. |
java.lang.String |
getName()
Returns the name of this port. |
mocgraph.Node |
getNode()
Returns the node associated with this port. |
Port |
getRelatedPort()
Returns the port that is connected to this port from the inside of the hierarchy. |
boolean |
isConnected()
Returns true if the port is connected, false otherwise. |
boolean |
isDisposed()
Returns true if this object is disposed and not available for future usage. |
boolean |
isRelated()
Returns true if the port is related, false otherwise. |
Port |
mirror(Hierarchy hierarchy,
mocgraph.analysis.strategy.MirrorTransformerStrategy transformation)
Mirrors a port without copying its connection field. |
java.lang.Object |
relate(mocgraph.Node node)
Defines an inner connection between a node and a port of a hierarchy. |
java.lang.Object |
relate(Port port)
Defines an inner connection between a sub-port and a port of a hierarchy. |
java.lang.String |
toString()
Returns the long name of this port. |
java.lang.Object |
unrelate()
Disconnects the inner connection of this port. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int IN
public static final int OUT
public static final int INOUT
Constructor Detail |
---|
public Port(java.lang.String name, Hierarchy hierarchy)
name
- Name of the port.hierarchy
- The hierarchy that contains this port.
HierarchyException
- If HierarchyException.checkPort(mapss.dif.graph.hierarchy.Hierarchy, mapss.dif.graph.hierarchy.Port)
returns an exception.
HierarchyException
- If
Conventions.labelConvention(java.lang.String)
returns an error.public Port(java.lang.String name, Hierarchy hierarchy, int direction)
name
- Name of the port.hierarchy
- The hierarchy that contains this port.direction
- IN
or OUT
.
HierarchyException
- If HierarchyException.checkPort(mapss.dif.graph.hierarchy.Hierarchy, mapss.dif.graph.hierarchy.Port)
returns an exception.
HierarchyException
- If
Conventions.labelConvention(java.lang.String)
returns an error.Method Detail |
---|
public java.lang.Object connect(mocgraph.Edge edge)
edge
- Edge to be connected.
HierarchyException
- If
HierarchyException.checkConnection(mocgraph.Edge, mapss.dif.graph.hierarchy.Port)
returns an exception.
HierarchyException
- If the port was disposed.public java.lang.Object connect(Port port)
port
- A port in the super hierarchy of this hierarchy.
HierarchyException
- If
HierarchyException.checkConnection(mocgraph.Edge, mapss.dif.graph.hierarchy.Port)
returns an exception.
HierarchyException
- If the port was disposed.public java.lang.Object disconnect()
superPort.unrelate()
is called too.
public void dispose()
HierarchyException
- If the port was already disposed.public java.lang.Object getConnection()
public int getDirection()
public Hierarchy getHierarchy()
public java.lang.String getName()
public mocgraph.Node getNode()
public Port getRelatedPort()
public boolean isConnected()
public boolean isDisposed()
public boolean isRelated()
public Port mirror(Hierarchy hierarchy, mocgraph.analysis.strategy.MirrorTransformerStrategy transformation)
MirrorTransformerStrategy
and
the hierarchy that is backed by the copy graph should be passed to this
method. The associated node of the port will be automatically converted
but connection of the port will be left undefined.
hierarchy
- The copy hierarchy backed up by the mirrored graph.transformation
- Transformer that mirrored the original graph.
Hierarchy.mirror(boolean)
public java.lang.Object relate(mocgraph.Node node)
connect(mocgraph.Edge)
in the way that, connect
defines a connection with a super hierarchy.
node
- A node in the hierarchy to which this node belongs.
public java.lang.Object relate(Port port)
connect(mocgraph.Edge)
in the way that, connect
defines a connection with a super hierarchy.
port
- A port in a sub-hierarchy of this hierarchy.
HierarchyException
- If
HierarchyException.checkConnection(mocgraph.Edge, mapss.dif.graph.hierarchy.Port)
returns an exception.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object unrelate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |