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

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

public class MappingFactory
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 MappingFactory.
private static MappingFactory mappingFactory
          A prototype for a Mapping factory such that only one instance class can ever exist.
private  java.util.List mappingList
           
 
Constructor Summary
private MappingFactory()
          Constructs a MappingFactory object.
 
Method Summary
 Mapping 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 MappingFactory getMappingFactory()
          Returns MappingFactory object; only one MappingFactory instance can exist.
static void main(java.lang.String[] args)
           
 java.lang.String toString()
          Returns a String object representing this MappingFactory.
 
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 MappingFactory.


mappingFactory

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


mappingList

private java.util.List mappingList
Constructor Detail

MappingFactory

private MappingFactory()
Constructs a MappingFactory object.

Method Detail

getInstance

public Mapping 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 MappingFactory.

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

getMappingFactory

public static MappingFactory getMappingFactory()
Returns MappingFactory object; only one MappingFactory instance can exist.

Returns:
MappingFactory object

main

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