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

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

public class EdifCellInstanceCollectionLink
extends java.lang.Object
implements Edge

An EdifLink class used in EdifCellInstanceCollectionGraph to show the connections between nodes (any object). It is basically a collection of EdifSourceSinkLinks that share the same source and sink. (A collection of its sibling)

The source and sink objects could be any object, but will generally be EdifCellInstanceCollection or EdifSingleBitPort objects.

Author:
Brian Pratt
See Also:
Serialized Form

Field Summary
protected  EdifCellInstanceGroupings _groups
           
protected  java.util.Collection<EdifCellInstanceEdge> _links
           
protected  java.lang.Object _sink
           
protected  java.lang.Object _source
           
 
Constructor Summary
EdifCellInstanceCollectionLink(java.lang.Object source, java.lang.Object sink, EdifCellInstanceGroupings groups)
           
 
Method Summary
 boolean addLink(EdifCellInstanceEdge link)
           
 void addLinkNoCheck(EdifCellInstanceEdge link)
          Adds an EdifCellInstanceEdge to this CollectionLink
 boolean addLinks(java.util.Collection links)
          Add a Collection of EdifCellInstanceEdge objects.
 java.util.Collection<EdifCellInstanceEdge> getLinks()
           
 java.util.Collection<EdifNet> getNets()
          Returns a Collection of EdifNets corresponding to the underlying connections in this EdifLink.
 java.lang.Object getSink()
          Return the sink object of a mathematical edge.
 java.lang.Object getSource()
          Return the source object of a mathematical edge.
 EdifCellInstanceCollectionLink invert()
          NOTE: A new EdifCellInstanceCollectionLink object is created as well as new EdifCellInstanceEdge objects for each of the inner edges
 boolean isSinkTopLevel()
           
 boolean isSourceTopLevel()
           
static boolean isTopLevel(java.lang.Object obj)
           
 void setSink(java.lang.Object node)
           
 void setSource(java.lang.Object node)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_links

protected java.util.Collection<EdifCellInstanceEdge> _links

_source

protected java.lang.Object _source

_sink

protected java.lang.Object _sink

_groups

protected EdifCellInstanceGroupings _groups
Constructor Detail

EdifCellInstanceCollectionLink

public EdifCellInstanceCollectionLink(java.lang.Object source,
                                      java.lang.Object sink,
                                      EdifCellInstanceGroupings groups)
Method Detail

isTopLevel

public static boolean isTopLevel(java.lang.Object obj)

addLinkNoCheck

public void addLinkNoCheck(EdifCellInstanceEdge link)
Adds an EdifCellInstanceEdge to this CollectionLink

WARNING: This method does not enforce that the added EdifCellInstanceEdge has the same source and sink as this collection.


addLink

public boolean addLink(EdifCellInstanceEdge link)

addLinks

public boolean addLinks(java.util.Collection links)
Add a Collection of EdifCellInstanceEdge objects. Only adds those links that match this CollectionLink.

Parameters:
links - A Collection of EdifCellInstanceEdge objects
Returns:
false if not *all* links were successfully added

getSource

public java.lang.Object getSource()
Description copied from interface: Edge
Return the source object of a mathematical edge.

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

getSink

public java.lang.Object getSink()
Description copied from interface: Edge
Return the sink object of a mathematical edge.

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

isSourceTopLevel

public boolean isSourceTopLevel()

isSinkTopLevel

public boolean isSinkTopLevel()

getLinks

public java.util.Collection<EdifCellInstanceEdge> getLinks()

getNets

public java.util.Collection<EdifNet> getNets()
Returns a Collection of EdifNets corresponding to the underlying connections in this EdifLink.


setSource

public void setSource(java.lang.Object node)

setSink

public void setSink(java.lang.Object node)

invert

public EdifCellInstanceCollectionLink invert()
NOTE: A new EdifCellInstanceCollectionLink object is created as well as new EdifCellInstanceEdge objects for each of the inner edges

Specified by:
invert in interface Edge
Returns:
An inverted version of this EdifCellInstanceCollectionLink

toString

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