com.ge.grc.acuity
Class PresentationParameterMap

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended bycom.ge.grc.acuity.PresentationParameterMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class PresentationParameterMap
extends java.util.Hashtable

This class is a simple extension to the java.util.Hashtable to allow the subject of a set of parameters on a PresentationObject to be stored along with the predicate (key) and value (Literal, Literal[], Individual, Individual[], PresentationParameterMap, or PresentationParameterMap[]). The last type is the value when the parameter is a composite parameter.

Version:
$Revision: 1.2 $ Last modified on $Date: 2006/09/08 22:38:45 $
Author:
crapo
See Also:
Serialized Form

Constructor Summary
PresentationParameterMap(java.lang.String _subjectUri)
          Call this constructor to create a new map.
PresentationParameterMap(java.lang.String _subjectUri, PresentationParameterMap _parent)
          Call this constructor to create a new map.
 
Method Summary
 java.lang.String canClone(AcuityController ac, com.hp.hpl.jena.ontology.Individual subject, com.hp.hpl.jena.ontology.OntProperty p, com.hp.hpl.jena.rdf.model.RDFNode oldObj)
           
 boolean equals(java.lang.Object o)
          Might be able to reduce this to just check subjects and not actual map contents
protected  java.util.List findSubMap(java.lang.String subj)
           
 java.util.Hashtable getMatchingParameters(java.lang.String propLocalName)
          Call this method to get the subject (key) and object (value) of all ontology Statements reflected in this map which have the input property local name as predicate.
protected  PresentationParameterMap getParent()
           
 java.lang.String getSubjectUri()
          Call this method to get the URI of the subject of the parameter map.
 boolean isParameterEditable(java.lang.Object key)
          Call this method to determine whether or not a Parameter in this PresentationParameterMap is editable.
protected  com.hp.hpl.jena.ontology.Individual replaceWithClone(AcuityController ac, com.hp.hpl.jena.ontology.Individual subject, com.hp.hpl.jena.ontology.OntProperty p, com.hp.hpl.jena.rdf.model.RDFNode oldObj, com.hp.hpl.jena.rdf.model.RDFNode newObj)
          Call this method to replace the Individual which is the subject of this map with a clone.
protected  void setParameterEditability(java.lang.Object key, boolean bEditable)
           
protected  void setParent(PresentationParameterMap parent)
           
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PresentationParameterMap

public PresentationParameterMap(java.lang.String _subjectUri)
Call this constructor to create a new map. The URI of the subject of the parameter triplets must be passed as an argument.

Parameters:
_subjectUri - - URI of the subject of the parameter map

PresentationParameterMap

public PresentationParameterMap(java.lang.String _subjectUri,
                                PresentationParameterMap _parent)
Call this constructor to create a new map. The URI of the subject of the parameter triplets as well as the map's parent map must be passed as arguments.

Parameters:
_subjectUri - - URI of the subject of the parameter map
Method Detail

getSubjectUri

public java.lang.String getSubjectUri()
Call this method to get the URI of the subject of the parameter map.

Returns:
- the subject URI

getMatchingParameters

public java.util.Hashtable getMatchingParameters(java.lang.String propLocalName)
Call this method to get the subject (key) and object (value) of all ontology Statements reflected in this map which have the input property local name as predicate. Submaps are "flattened" to give only Individual, Individual[], Literal, or Literal[] as values.

Parameters:
propLocalName - - the local name of the Property to be used as key in search
Returns:
- a Hashtable for the matching Statements with the Statement subject as key and the Statement object as value

setParameterEditability

protected void setParameterEditability(java.lang.Object key,
                                       boolean bEditable)

isParameterEditable

public boolean isParameterEditable(java.lang.Object key)
Call this method to determine whether or not a Parameter in this PresentationParameterMap is editable.

Parameters:
key - - the Parameter key
Returns:
- true if editable else false

findSubMap

protected java.util.List findSubMap(java.lang.String subj)

replaceWithClone

protected com.hp.hpl.jena.ontology.Individual replaceWithClone(AcuityController ac,
                                                               com.hp.hpl.jena.ontology.Individual subject,
                                                               com.hp.hpl.jena.ontology.OntProperty p,
                                                               com.hp.hpl.jena.rdf.model.RDFNode oldObj,
                                                               com.hp.hpl.jena.rdf.model.RDFNode newObj)
                                                        throws AcuityException
Call this method to replace the Individual which is the subject of this map with a clone. Then update the map and check for the need to clone ancestor maps.

Parameters:
subject - - the Individual that is the subject of the old statement and that is being replaced with the new clone
newObj - - the new value which is to be assigned in the clone
Returns:
Throws:
AcuityException

canClone

public java.lang.String canClone(AcuityController ac,
                                 com.hp.hpl.jena.ontology.Individual subject,
                                 com.hp.hpl.jena.ontology.OntProperty p,
                                 com.hp.hpl.jena.rdf.model.RDFNode oldObj)
                          throws AcuityException
Parameters:
p -
Returns:
Throws:
AcuityException

setParent

protected void setParent(PresentationParameterMap parent)
Parameters:
parent - The parent to set.

getParent

protected PresentationParameterMap getParent()
Returns:
Returns the parent.

equals

public boolean equals(java.lang.Object o)
Might be able to reduce this to just check subjects and not actual map contents