org.aitools.programd.multiplexor
Class PredicateMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,PredicateValue>
          extended by org.aitools.programd.multiplexor.PredicateMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,PredicateValue>

public class PredicateMap
extends java.util.HashMap<java.lang.String,PredicateValue>

A map of predicate names to values.

Since:
4.5
Author:
Noel Bush
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
PredicateMap()
          Creates a new PredicateMap.
 
Method Summary
 PredicateValue get(java.lang.String name)
          Returns the value associated with the given name.
 void put(java.lang.String name, java.util.ArrayList<java.lang.String> values)
          Puts a multi-valued predicate into the map.
 void put(java.lang.String name, java.lang.String value)
          Puts a single-valued predicate into the map.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

PredicateMap

public PredicateMap()
Creates a new PredicateMap.

Method Detail

put

public void put(java.lang.String name,
                java.lang.String value)
Puts a single-valued predicate into the map.

Parameters:
name - the predicate name
value - the predicate value

put

public void put(java.lang.String name,
                java.util.ArrayList<java.lang.String> values)
Puts a multi-valued predicate into the map.

Parameters:
name - the predicate name
values - the predicate values

get

public PredicateValue get(java.lang.String name)
                   throws NoSuchPredicateException
Returns the value associated with the given name.

Parameters:
name - the name of the predicate whose value is wanted
Returns:
the value of the named predicate
Throws:
NoSuchPredicateException - if no such predicate exists