edu.byu.ece.edif.util.graph
Class EdifCellInstanceEdge

java.lang.Object
  extended by edu.byu.ece.edif.util.graph.EdifCellInstanceEdge
All Implemented Interfaces:
EdifPortRefEdge, Edge, java.io.Serializable

public class EdifCellInstanceEdge
extends java.lang.Object
implements EdifPortRefEdge

Represents a mathematical graph edge between a source EdifPortRef object and a sink EdifPortRef object associated with a single EdifNet object.

This is different from a EdifNet object in that this object only keeps track of a source sink pair. A single EdifNet object may represent many EdifCellInstanceEdge objects. Specifically, there is one EdifCellInstanceEdge object for each source/sink pair in the net.

See Also:
Serialized Form

Field Summary
protected  EdifPortRef _sinkEPR
          The EdifPortRef object associated with the sink of this edge.
protected  EdifPortRef _sourceEPR
          The EdifPortRef object associated with the source of this edge.
 
Constructor Summary
EdifCellInstanceEdge(EdifPortRef source, EdifPortRef sink)
          Construct a new link from a given source and sink EdifPortRef object.
 
Method Summary
 EdifNet getNet()
          Return the EdifNet object associated with this link.
 java.lang.Object getSink()
          Return the sink node object associated with this link.
 EdifPortRef getSinkEPR()
          Return the EdifPortRef object associated with the sink of this link.
 java.lang.Object getSource()
          Return the source node object assoicated with this link.
 EdifPortRef getSourceEPR()
          Return the EdifPortRef object associated with the source of this link.
 EdifCellInstanceEdge invert()
          Create a edge that is the inverse of this edge (i.e.
static boolean isEdifSingleBitPort(java.lang.Object obj)
          Indiciate if the given object is a EdifSingleBitPort object.
 boolean isSinkTopLevel()
          Return true if sink is associated with a top-level port.
 boolean isSourceTopLevel()
          Return true if source is associated with a top-level port.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_sourceEPR

protected EdifPortRef _sourceEPR
The EdifPortRef object associated with the source of this edge.


_sinkEPR

protected EdifPortRef _sinkEPR
The EdifPortRef object associated with the sink of this edge.

Constructor Detail

EdifCellInstanceEdge

public EdifCellInstanceEdge(EdifPortRef source,
                            EdifPortRef sink)
Construct a new link from a given source and sink EdifPortRef object.

Method Detail

isEdifSingleBitPort

public static boolean isEdifSingleBitPort(java.lang.Object obj)
Indiciate if the given object is a EdifSingleBitPort object.


getSource

public java.lang.Object getSource()
Return the source node object assoicated with this link. If the source is a top-level port, this method will return the EdifSingleBitPort associated with this link. If the source is not a top-level port, this method will return the EdifCellInstance associated with the source EdifPortRef object.

Specified by:
getSource in interface Edge
Returns:
Source object.

getSink

public java.lang.Object getSink()
Return the sink node object associated with this link. If the sink is a top-level port, this method will return the EdifSingleBitPort associated with this link. If the sink is not a top-level port, this method will return the EdifCellInstance associated with the source EdifPortRef object.

Specified by:
getSink in interface Edge
Returns:
sink object.

isSourceTopLevel

public boolean isSourceTopLevel()
Return true if source is associated with a top-level port. Return false if source is associated with an EdifCellInstance.


isSinkTopLevel

public boolean isSinkTopLevel()
Return true if sink is associated with a top-level port. Return false if sink is associated with an EdifCellInstance.


getSourceEPR

public EdifPortRef getSourceEPR()
Return the EdifPortRef object associated with the source of this link.

Specified by:
getSourceEPR in interface EdifPortRefEdge
Returns:
The EdifPortRef associated with the "source" of this edge.

getSinkEPR

public EdifPortRef getSinkEPR()
Return the EdifPortRef object associated with the sink of this link.

Specified by:
getSinkEPR in interface EdifPortRefEdge
Returns:
The EdifPortRef associated with the "sink" of this edge.

getNet

public EdifNet getNet()
Return the EdifNet object associated with this link.

Specified by:
getNet in interface EdifPortRefEdge

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

invert

public EdifCellInstanceEdge invert()
Create a edge that is the inverse of this edge (i.e. the source and sinks are reversed.

Specified by:
invert in interface Edge
Returns:
sink object.