com.sun.electric.database.topology
Class Topology

java.lang.Object
  extended by com.sun.electric.database.topology.Topology

public class Topology
extends java.lang.Object

A class to manage nodes and arcs of a Cell.


Constructor Summary
Topology(Cell cell, boolean loadBackup)
          Creates a new instance of Topology
 
Method Summary
 ImmutableArcInst[] backupArcs(ImmutableArrayList<ImmutableArcInst> oldArcs)
           
 void check()
          Method to check invariants in this Cell.
 void computeArcBounds()
          Low-level routine.
 ArcInst findArc(java.lang.String name)
          Method to find a named ArcInst on this Cell.
 ArcInst getArc(int arcIndex)
          Method to return the ArcInst at specified position.
 ArcInst getArcById(int arcId)
          Method to return the ArcInst by its chronological index.
 java.util.Iterator<ArcInst> getArcs()
          Method to return an Iterator over all ArcInst objects in this Cell.
 int getNumArcs()
          Method to return the number of ArcInst objects in this Cell.
 RTNode getRTree()
          Method to R-Tree of this Cell.
 void rebuildRTree()
           
 java.util.Iterator<RTBounds> searchIterator(java.awt.geom.Rectangle2D bounds, boolean includeEdges)
          Method to return an interator over all RTBounds objects in a given area of this Cell that allows to ignore elements touching the area.
 void unfreshRTree()
           
 void updateArcs(CellRevision newRevision)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Topology

public Topology(Cell cell,
                boolean loadBackup)
Creates a new instance of Topology

Method Detail

getArcs

public java.util.Iterator<ArcInst> getArcs()
Method to return an Iterator over all ArcInst objects in this Cell.

Returns:
an Iterator over all ArcInst objects in this Cell.

getNumArcs

public int getNumArcs()
Method to return the number of ArcInst objects in this Cell.

Returns:
the number of ArcInst objects in this Cell.

getArc

public final ArcInst getArc(int arcIndex)
Method to return the ArcInst at specified position.

Parameters:
arcIndex - specified position of ArcInst.
Returns:
the ArcInst at specified position..

getArcById

public ArcInst getArcById(int arcId)
Method to return the ArcInst by its chronological index.

Parameters:
arcId - chronological index of ArcInst.
Returns:
the ArcInst with specified chronological index.

findArc

public ArcInst findArc(java.lang.String name)
Method to find a named ArcInst on this Cell.

Parameters:
name - the name of the ArcInst.
Returns:
the ArcInst. Returns null if none with that name are found.

backupArcs

public ImmutableArcInst[] backupArcs(ImmutableArrayList<ImmutableArcInst> oldArcs)

updateArcs

public void updateArcs(CellRevision newRevision)

computeArcBounds

public void computeArcBounds()
Low-level routine.


searchIterator

public java.util.Iterator<RTBounds> searchIterator(java.awt.geom.Rectangle2D bounds,
                                                   boolean includeEdges)
Method to return an interator over all RTBounds objects in a given area of this Cell that allows to ignore elements touching the area. Note that Geometric objects implement RTBounds, so for database searches, the iterator returns Geometrics (NodeInsts and ArcInsts).

Parameters:
bounds - the specified area to search.
includeEdges - true if RTBounds objects along edges are considered in.
Returns:
an iterator over all of the RTBounds objects in that area.

unfreshRTree

public void unfreshRTree()

getRTree

public RTNode getRTree()
Method to R-Tree of this Cell. The R-Tree organizes all of the Geometric objects spatially for quick search.

Returns:
R-Tree of this Cell.

rebuildRTree

public void rebuildRTree()

check

public void check()
Method to check invariants in this Cell.

Throws:
java.lang.AssertionError - if invariants are not valid