byucc.edif
Class AbstractEdifNameSpace

java.lang.Object
  extended by byucc.edif.AbstractEdifNameSpace
All Implemented Interfaces:
EdifNameSpace, Trimable
Direct Known Subclasses:
EdifNameSpaceList, EdifNameSpaceMap

public abstract class AbstractEdifNameSpace
extends java.lang.Object
implements EdifNameSpace

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.

Author:
Mike Wirthlin

Constructor Summary
AbstractEdifNameSpace()
           
 
Method Summary
 void add(Nameable en)
          Adds a EdifNameable object to the Collection.
protected abstract  void addImplementation(Nameable en)
           
 java.lang.String addUniqueName(NamedPropertyObject en)
          Adds a EdifNameable object to the Collection.
 boolean nameClash(Nameable en)
          Determines if the given named object will clash with the names in this given EdifNameSpace.
 boolean nameClash(java.lang.String str)
          Indicates that there is a name clash within this Collection.
 java.lang.String returnUniqueName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface byucc.edif.EdifNameSpace
contains, get, iterator, remove, size
 
Methods inherited from interface byucc.edif.Trimable
trimToSize
 

Constructor Detail

AbstractEdifNameSpace

public AbstractEdifNameSpace()
Method Detail

nameClash

public boolean nameClash(java.lang.String str)
Description copied from interface: EdifNameSpace
Indicates that there is a name clash within this Collection.

Specified by:
nameClash in interface EdifNameSpace
Parameters:
str - The String object that is to be compared against the collection. Note that this method will perform the check using case insensitivity.
Returns:
true if there is a clash, false if there is no clash.

nameClash

public boolean nameClash(Nameable en)
Description copied from interface: EdifNameSpace
Determines if the given named object will clash with the names in this given EdifNameSpace.

Specified by:
nameClash in interface EdifNameSpace
Parameters:
en - The EdifNameable object that is to be compared against the name space
Returns:
true if there is a clash, false if there is no clash.

addUniqueName

public java.lang.String addUniqueName(NamedPropertyObject en)
Description copied from interface: EdifNameSpace
Adds a EdifNameable object to the Collection. This method will check to see if there is a conflict. If there is a conflict, this method will change the name of the EdifNameable object and add it to the Collection.

Specified by:
addUniqueName in interface EdifNameSpace
Parameters:
en - Add the named object to the name space. The name of the object is associated with name of the NamedPropertyObject.
Returns:
Returns a String specifying the unique name. If the name is not changed, the original name is returned. If the name is changed, the new name is returned.

returnUniqueName

public java.lang.String returnUniqueName(java.lang.String name)

addImplementation

protected abstract void addImplementation(Nameable en)

add

public void add(Nameable en)
         throws EdifNameConflictException
Description copied from interface: EdifNameSpace
Adds a EdifNameable object to the Collection. This method will check to see if there is a conflict and throw an exception if there is a conflict.

Specified by:
add in interface EdifNameSpace
Parameters:
en - Add the named object to the name space. The name of the object is associated with name of the NamedPropertyObject.
Throws:
EdifNameConflictException - This exception is thrown when a name conflict occurs during the add.