edu.byu.ece.edif.core
Class EdifNameSpaceUtils

java.lang.Object
  extended by edu.byu.ece.edif.core.EdifNameSpaceUtils
All Implemented Interfaces:
java.io.Serializable

public class EdifNameSpaceUtils
extends java.lang.Object
implements java.io.Serializable

An abstract implementation of the EdifNameSpace. This class does not have any implementation specific code (i.e. storage of the name space) but does provide a number of helper functions that simplify the process of creating an EdifNameSpace.

Version:
$Id:EdifNameSpaceUtils.java 198 2008-04-16 21:14:21Z jamesfcarroll $
See Also:
Serialized Form

Field Summary
private  EdifNameClashPolicy _clashPolicy
          The EdifNameClashPolicy to use for the collection associated with this instance of EdifNameSpaceUtils
private  EdifNameSpace _nameSpace
          The EdifNameSpace associated with this instance of EdifNameSpaceUtils
 
Constructor Summary
EdifNameSpaceUtils(EdifNameSpace nameSpace, EdifNameClashPolicy clashPolicy)
           
 
Method Summary
 boolean nameClash(EdifNameable en)
          Determine whether the given EdifNameable will cause a name clash with the current name space.
 boolean nameClashNew(RenamedObject en)
          Determine whether the given RenamedObject will cause a name clash with an exiting new name in the current name space.
 boolean nameClashNew(java.lang.String newName)
          Determine whether the given String will cause a name clash with an existing new name in the current name space.
 boolean nameClashOld(RenamedObject en)
          Determine whether the given RenamedObject will cause a name clash with an existing old name in the current name space.
 boolean nameClashOld(java.lang.String oldName)
          Determine whether the given String will cause a name clash with an existing old name in the current name space.
 boolean nameClashSingle(NamedObject en)
          Determine whether the given NamedObject will cause a name clash with an existing single name in the current name space.
 boolean nameClashSingle(java.lang.String single)
          Determine whether the given String will cause a name clash with an existing single name in the current name space.
 EdifNameable returnUniqueNameable(EdifNameable en)
          Create an EdifNameable object based on the given one that will not clash with any of the existing names in the current name space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_clashPolicy

private EdifNameClashPolicy _clashPolicy
The EdifNameClashPolicy to use for the collection associated with this instance of EdifNameSpaceUtils


_nameSpace

private EdifNameSpace _nameSpace
The EdifNameSpace associated with this instance of EdifNameSpaceUtils

Constructor Detail

EdifNameSpaceUtils

public EdifNameSpaceUtils(EdifNameSpace nameSpace,
                          EdifNameClashPolicy clashPolicy)
Method Detail

nameClash

public boolean nameClash(EdifNameable en)
Determine whether the given EdifNameable will cause a name clash with the current name space.

Parameters:
en - the EdifNameable to compare with the name space
Returns:
a boolean indicating whether there is a clash

nameClashNew

public boolean nameClashNew(RenamedObject en)
Determine whether the given RenamedObject will cause a name clash with an exiting new name in the current name space.

Parameters:
en - the RenamedObject to compare with the name space
Returns:
a boolean indicating whether there is a clash

nameClashNew

public boolean nameClashNew(java.lang.String newName)
Determine whether the given String will cause a name clash with an existing new name in the current name space.

Parameters:
newName - the String to compare with the name space
Returns:
a boolean indicating whether there is a clash

nameClashOld

public boolean nameClashOld(RenamedObject en)
Determine whether the given RenamedObject will cause a name clash with an existing old name in the current name space.

Parameters:
en - the RenamedObject to compare with the name space
Returns:
a boolean indicating whether there is a clash

nameClashOld

public boolean nameClashOld(java.lang.String oldName)
Determine whether the given String will cause a name clash with an existing old name in the current name space.

Parameters:
oldName - the String to compare with the name space
Returns:
a boolean indicating whether there is a clash

nameClashSingle

public boolean nameClashSingle(NamedObject en)
Determine whether the given NamedObject will cause a name clash with an existing single name in the current name space.

Parameters:
en - the NamedObject to compare with the name space
Returns:
a boolean indicating whether there is a clash

nameClashSingle

public boolean nameClashSingle(java.lang.String single)
Determine whether the given String will cause a name clash with an existing single name in the current name space.

Parameters:
single - the String to compare with the name space
Returns:
a boolean indicating whether there is a clash

returnUniqueNameable

public EdifNameable returnUniqueNameable(EdifNameable en)
Create an EdifNameable object based on the given one that will not clash with any of the existing names in the current name space.

Parameters:
en - the EdifNameable object to use as a basis for a unique name
Returns:
a new unique EdifNameable object