edu.byu.ece.edif.core
Interface NameSpaceResolver

All Known Implementing Classes:
ArrayListNameSpaceResolver, HashMapNameSpaceResolver

public interface NameSpaceResolver

Resolves String name conflicts. This class will contain methods that all interfaces need to implement. There are four classes that need to be wrapped in a name space; these classes are: EdifLibrary, EdifCell, EdifNet, and EdifCellInstance.

Memory Consumption Tests on Name Space (in bytes): Note: The first # is memory usage at program termination, GC is memory that was garbage collected, and the total memory consumption is memory consumption at termination plus the memory that was garbage collected.

Time for HashMap on EdifNets fpga_a.edf: 113 s
Time for HashSet on EdifNets fpga_a.edf: 156 s
Time for ArrayList on fpga_a.edf: 150 s
Time for HashMap on EdifNets and EdifCellInstances on fpga_a.edf: 35 s!

Version:
$Id:NameSpaceResolver.java 198 2008-04-16 21:14:21Z jamesfcarroll $

Method Summary
 boolean nameClash(java.lang.String newName)
          Returns true if name does not clash with name space.
 java.lang.String returnUniqueName(java.lang.String name)
          If the name is valid, return name.
 java.lang.String toString()
          Return a string representation of this object.
 

Method Detail

nameClash

boolean nameClash(java.lang.String newName)
Returns true if name does not clash with name space. Currently converts everything to upper case.

Parameters:
newName - Name to check if it already exists in the name space.
Returns:
True if the name clashes, false if it doesn't exist in the name space.

returnUniqueName

java.lang.String returnUniqueName(java.lang.String name)
If the name is valid, return name. If not, make it valid. It grabs a random element from an array and keeps appending it from the array.

Parameters:
name - Name to modify, and make unique for this name space.
Returns:
The string unique to this name space.

toString

java.lang.String toString()
Return a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
String representing this name space object.