org.itc.irst.tcc.sre.kernel.expl
Class ContextMappingFactory

java.lang.Object
  extended by org.itc.irst.tcc.sre.kernel.expl.ContextMappingFactory

public class ContextMappingFactory
extends java.lang.Object

Factory class for vending standard Mapping objects. Wherever possible, this factory will hand out references to shared Mapping instances.

Since:
1.0
Version:
1.0
Author:
Claudio Giuliano

Field Summary
(package private) static org.apache.log4j.Logger logger
          Define a static logger variable so that it references the Logger instance named ContextMappingFactory.
private static ContextMappingFactory mappingFactory
          A prototype for a Mapping factory such that only one instance class can ever exist.
private  java.util.List mappingList
           
 
Constructor Summary
private ContextMappingFactory()
          Constructs a ContextMappingFactory object.
 
Method Summary
static ContextMappingFactory getContextMappingFactory()
          Returns ContextMappingFactory object; only one ContextMappingFactory instance can exist.
 ContextMapping getInstance(java.lang.String name)
          Returns the id of the specified Mapping and adds the Mapping to the lexicon if it is not present yet.
static void main(java.lang.String[] args)
           
 java.lang.String toString()
          Returns a String object representing this ContextMappingFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
Define a static logger variable so that it references the Logger instance named ContextMappingFactory.


mappingFactory

private static ContextMappingFactory mappingFactory
A prototype for a Mapping factory such that only one instance class can ever exist.


mappingList

private java.util.List mappingList
Constructor Detail

ContextMappingFactory

private ContextMappingFactory()
Constructs a ContextMappingFactory object.

Method Detail

getInstance

public ContextMapping getInstance(java.lang.String name)
                           throws MappingNotFoundException
Returns the id of the specified Mapping and adds the Mapping to the lexicon if it is not present yet.

If the lexicon is read only, mappings not already present in the lexicon will not be added and a null id will be returned.

Parameters:
name - the string representation of the Mapping.
Returns:
the id of the specified Mapping.
Throws:
MappingNotFoundException

toString

public java.lang.String toString()
Returns a String object representing this ContextMappingFactory.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object.

getContextMappingFactory

public static ContextMappingFactory getContextMappingFactory()
Returns ContextMappingFactory object; only one ContextMappingFactory instance can exist.

Returns:
ContextMappingFactory object

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception