org.jlab.coda.jevio
Class NameProvider

java.lang.Object
  extended by org.jlab.coda.jevio.NameProvider

public class NameProvider
extends java.lang.Object

This class maintains the single global NameProvider. There is no default name provider, so if the application doesn't provide one, the static method getName will always return the constant NO_NAME_STRING, which will be something like "NO_NAME_STRING". Typically at start up an application will locate a dictionary file, use the NameProviderFactory to create a INameProvider, and then call the static method @link #setProvider(INameProvider).

Author:
heddle

Method Summary
static java.lang.String getName(BaseStructure structure)
          Returns the pretty name of some evio structure.
static boolean isProviderSet()
          Returns true if the provider (dictionary) was set, else false.
static void setProvider(INameProvider aProvider)
          Sets the one global (singleton) name provider.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isProviderSet

public static boolean isProviderSet()
Returns true if the provider (dictionary) was set, else false.

Returns:
true if the provider (dictionary) was set, else false.

setProvider

public static void setProvider(INameProvider aProvider)
Sets the one global (singleton) name provider.

Parameters:
aProvider - the provider to use.

getName

public static java.lang.String getName(BaseStructure structure)
Returns the pretty name of some evio structure. Typically this is involve the use of the "tag" and, if present, "num" fields. There may also be a hierarchical dependence.

Parameters:
structure - the structure to find the name of.
Returns:
a descriptive name, e.g., "Edep".