edu.umich.soar.hpp
Class HPPKnowledgeBase

java.lang.Object
  extended by edu.umich.soar.hpp.HPPKnowledgeBase

public class HPPKnowledgeBase
extends java.lang.Object

Somewhat efficient support for a set of multi-valued variables


Constructor Summary
HPPKnowledgeBase()
          Basic empty-KB constructor
 
Method Summary
 void addVariable(java.lang.String varName, java.lang.String varValue)
          Append a variable to the KB
 boolean containsVariable(java.lang.String varName)
          Supports search by variable name
 boolean containsVariableValue(java.lang.String varName, java.lang.String varValue)
          Supports search by variable name+value
 java.util.Set<java.lang.String> getVariables()
          Supports read-only access to all variable names
 java.util.Iterator<HPPGivenVariable> getVariableValues(java.lang.String varName)
          Supports read-only access to all the values of a variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HPPKnowledgeBase

public HPPKnowledgeBase()
Basic empty-KB constructor

Method Detail

addVariable

public void addVariable(java.lang.String varName,
                        java.lang.String varValue)
Append a variable to the KB

Parameters:
varName - variable name
varValue - variable value

getVariableValues

public java.util.Iterator<HPPGivenVariable> getVariableValues(java.lang.String varName)
Supports read-only access to all the values of a variable

Parameters:
varName - variable name
Returns:
iterator to variable value(s), or null if KB does not contain the variable

getVariables

public java.util.Set<java.lang.String> getVariables()
Supports read-only access to all variable names

Returns:
the set of variable names

containsVariable

public boolean containsVariable(java.lang.String varName)
Supports search by variable name

Parameters:
varName - variable name
Returns:
returns true if the KB has at least one value for the variable

containsVariableValue

public boolean containsVariableValue(java.lang.String varName,
                                     java.lang.String varValue)
Supports search by variable name+value

Parameters:
varName - variable name
varValue - variable value
Returns:
returns true if the KB has the precise variable name+value pair