edu.byu.ece.edif.core
Interface EdifNameSpace<E extends NamedPropertyObject>

All Superinterfaces:
Trimable
All Known Implementing Classes:
EdifNameSpaceList, EdifNameSpaceMap

public interface EdifNameSpace<E extends NamedPropertyObject>
extends Trimable

A group of Nameable objects each with a unique String name. The group specifies a name space of unique names for EdifNameable objects. Each name in the space is unique and methods are provided for creating and checking for uniqueness. Each unique name is associated with a EdifNameable object.

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

Method Summary
 void addElement(E element)
          Add an EdifNameable object to the name space.
 boolean contains(E element)
          Indicate whether the given EdifNameable object is a member of the name space.
 boolean containsNew(java.lang.String name)
          Indicate whether the name space contains a new name (part of a RenamedObject) that matches the given string.
 boolean containsOld(java.lang.String name)
          Indicate whether the name space contains an old name (part of a RenamedObject) that matches the given string.
 boolean containsSingle(java.lang.String name)
          Indicate whether the name space contains a single name (as a NamedObject) that matches the given string.
 E get(java.lang.String name)
          Return the Nameable object associated with this name space that matches the given String name.
 EdifNameable getUniqueNameable(E element)
          Determine a name based on the name of the given element that will not clash with any names already in the name space.
 EdifNameable getUniqueNameable(EdifNameable en)
          Determine a name based on the given name that will not clash with any names already in the name space.
 java.util.Iterator<E> iterator()
          Return an Iterator for all Nameable objects in the name space
 boolean nameClash(E element)
          Determine if the given elements name will clash with the names already in the name space.
 boolean nameClash(EdifNameable en)
          Determine if the given name will clash with the names in this given EdifNameSpace.
 int size()
          Indicate the number of members of the name space
 
Methods inherited from interface edu.byu.ece.edif.core.Trimable
trimToSize
 

Method Detail

addElement

void addElement(E element)
                throws EdifNameConflictException
Add an EdifNameable object to the name space. This method will check to see if there is a conflict and throw an exception if there is a conflict.

Parameters:
e - 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.

contains

boolean contains(E element)
Indicate whether the given EdifNameable object is a member of the name space. The search is performed using the name of the object.

Parameters:
e - The NamedPropertyObject to search for in the name space.
Returns:
true if the object is a member of the space. false if it is not a member of the space.

get

E get(java.lang.String name)
Return the Nameable object associated with this name space that matches the given String name.

Parameters:
name -
Returns:
The Nameable object within this name space. This will return a null if an object of the given name does not exist.

getUniqueNameable

EdifNameable getUniqueNameable(E element)
Determine a name based on the name of the given element that will not clash with any names already in the name space.

Parameters:
element - the element whose name will be used as a basis for a unique name
Returns:
a unique name

getUniqueNameable

EdifNameable getUniqueNameable(EdifNameable en)
Determine a name based on the given name that will not clash with any names already in the name space.

Parameters:
en - the name to use as a basis for a unique name.
Returns:
a unique name

iterator

java.util.Iterator<E> iterator()
Return an Iterator for all Nameable objects in the name space

Returns:
Iterator over all Nameable objects in the name space.

nameClash

boolean nameClash(E element)
Determine if the given elements name will clash with the names already in the name space.

Parameters:
element - the element whose name will be compared with the name space
Returns:
a boolean indicating whether there will be a clash

nameClash

boolean nameClash(EdifNameable en)
Determine if the given name will clash with the names in this given EdifNameSpace.

Parameters:
en - the name that will be compared with the name space
Returns:
a boolean indicating whether there will be a clash

containsNew

boolean containsNew(java.lang.String name)
Indicate whether the name space contains a new name (part of a RenamedObject) that matches the given string.

Parameters:
name - the string to match against
Returns:
a boolean indicating whether a match was found

containsOld

boolean containsOld(java.lang.String name)
Indicate whether the name space contains an old name (part of a RenamedObject) that matches the given string.

Parameters:
name - the string to match against
Returns:
a boolean indicating whether a match was found

containsSingle

boolean containsSingle(java.lang.String name)
Indicate whether the name space contains a single name (as a NamedObject) that matches the given string.

Parameters:
name - the string to match against
Returns:
a boolean indicating whether a match was found

size

int size()
Indicate the number of members of the name space

Returns:
The number of elements in the name space.