org.kuali.student.core.statement.naturallanguage
Class ContextRegistry<T extends Context<?>>

java.lang.Object
  extended by org.kuali.student.core.statement.naturallanguage.ContextRegistry<T>

public class ContextRegistry<T extends Context<?>>
extends Object

This class is a registry of template contexts which the requirement component translator uses to generate natural language.


Field Summary
private  Map<String,List<T>> registry
          Registry context map
 
Constructor Summary
ContextRegistry()
          Constructor.
ContextRegistry(Map<String,List<T>> registry)
          Constructor.
 
Method Summary
 void add(String key, T context)
          Adds a context to the registry.
 boolean containsKey(String key)
          Returns true if a context exists for key; otherwise false.
 List<T> get(String key)
          Gets a context from the registry.
 List<T> remove(String key)
          Remove a context from the registry.
 int size()
          Returns the number of keys of the registry.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

registry

private Map<String,List<T extends Context<?>>> registry
Registry context map

Constructor Detail

ContextRegistry

public ContextRegistry()
Constructor.


ContextRegistry

public ContextRegistry(Map<String,List<T>> registry)
Constructor. Adds a context registry as a map.

Parameters:
registry - Context registry
Method Detail

add

public void add(String key,
                T context)
Adds a context to the registry. Key is usually a <@link ReqComponentType key.

Parameters:
key - Context key
context - Context

get

public List<T> get(String key)
Gets a context from the registry. Key is usually a <@link ReqComponentType key.

Parameters:
key - Context key
Returns:
A context

containsKey

public boolean containsKey(String key)
Returns true if a context exists for key; otherwise false.

Parameters:
key - Context key
Returns:
True if a context exists otherwise false

remove

public List<T> remove(String key)
Remove a context from the registry. Key is usually a <@link ReqComponentType key.

Parameters:
key -
Returns:

size

public int size()
Returns the number of keys of the registry.

Returns:
Number of keys in the registry

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.