byucc.edif
Class AbstractNameSpaceResolver

java.lang.Object
  extended bybyucc.edif.AbstractNameSpaceResolver
All Implemented Interfaces:
java.io.Serializable

public abstract class AbstractNameSpaceResolver
extends java.lang.Object
implements java.io.Serializable

Abstract class that contains methods for name space resolvers. Other name space classes will call the methods of this one. If another data type is desired for the name space then in the constructor of the other name space object _names is instantiated. This class is abstract and doesn't and doesn't implement an interface because interface methods can't be declared abstract.

Version:
$Id: AbstractNameSpaceResolver.java,v 1.16 2004/08/27 19:16:41 tsa6 Exp $
Author:
Eric Johnson, Tyler Anderson
See Also:
Serialized Form

Field Summary
private static char[] _random
          String containing characters to randomly append to a name.
 
Constructor Summary
AbstractNameSpaceResolver()
           
 
Method Summary
static boolean nameClash(java.util.Collection list, java.lang.String newName)
          Returns true if name does not clash with name space.
static boolean nameClash(java.util.Map map, java.lang.String name)
          Returns true if name does not clash with name space.
static java.lang.String returnUniqueName(java.util.Collection list, java.lang.String name)
          If the name is valid, return name.
static java.lang.String returnUniqueName(java.util.Map map, java.lang.String name)
          If the name is valid, return name.
static java.lang.String toString(java.util.Collection list)
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_random

private static char[] _random
String containing characters to randomly append to a name.

Constructor Detail

AbstractNameSpaceResolver

public AbstractNameSpaceResolver()
Method Detail

nameClash

public static boolean nameClash(java.util.Collection list,
                                java.lang.String newName)
Returns true if name does not clash with name space.

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

nameClash

public static boolean nameClash(java.util.Map map,
                                java.lang.String name)
Returns true if name does not clash with name space.

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

returnUniqueName

public static java.lang.String returnUniqueName(java.util.Collection list,
                                                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.
list - The name space passed to this method.
Returns:
The string unique to this name space.

returnUniqueName

public static java.lang.String returnUniqueName(java.util.Map map,
                                                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.
map - The name space passed to this method.
Returns:
The string unique to this name space.

toString

public static java.lang.String toString(java.util.Collection list)
Returns a string representation of this object.

Returns:
String representing this name space object.