info.sswap.impl.empire.model
Class ReasoningServiceImpl.IndividualTranslator.TranslationCache

java.lang.Object
  extended by info.sswap.impl.empire.model.ReasoningServiceImpl.IndividualTranslator.TranslationCache
Enclosing class:
ReasoningServiceImpl.IndividualTranslator

private class ReasoningServiceImpl.IndividualTranslator.TranslationCache
extends java.lang.Object

Contains cache of translation results.

Author:
Blazej Bulka

Field Summary
private  java.util.Map<ReasoningServiceImpl.ReasoningTaskBase.ClassIndividualMapping,java.util.Collection<com.hp.hpl.jena.rdf.model.Statement>> contents
          Maps a pair (class + individual) onto the result of its translation (collection of statements)
private  java.util.Map<ReasoningServiceImpl.ReasoningTaskBase.ClassIndividualMapping,ValidationException> validationExceptions
           
 
Constructor Summary
private ReasoningServiceImpl.IndividualTranslator.TranslationCache()
           
 
Method Summary
 void cache(aterm.ATermAppl clazz, aterm.ATermAppl individual, java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translation)
          Stores the results of translation of the given class and individual.
 void cacheValidationException(aterm.ATermAppl clazz, aterm.ATermAppl individual, ValidationException exception)
           
 java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> getCached(aterm.ATermAppl clazz, aterm.ATermAppl individual)
          Gets the cached translation results for the given class and individual
 boolean isCached(aterm.ATermAppl clazz, aterm.ATermAppl individual)
          Checks whether the results for the given class and individual are already cached
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contents

private java.util.Map<ReasoningServiceImpl.ReasoningTaskBase.ClassIndividualMapping,java.util.Collection<com.hp.hpl.jena.rdf.model.Statement>> contents
Maps a pair (class + individual) onto the result of its translation (collection of statements)


validationExceptions

private java.util.Map<ReasoningServiceImpl.ReasoningTaskBase.ClassIndividualMapping,ValidationException> validationExceptions
Constructor Detail

ReasoningServiceImpl.IndividualTranslator.TranslationCache

private ReasoningServiceImpl.IndividualTranslator.TranslationCache()
Method Detail

isCached

public boolean isCached(aterm.ATermAppl clazz,
                        aterm.ATermAppl individual)
Checks whether the results for the given class and individual are already cached

Parameters:
clazz - the class
individual - the individual
Returns:
true if the results are cached

getCached

public java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> getCached(aterm.ATermAppl clazz,
                                                                           aterm.ATermAppl individual)
                                                                    throws ValidationException
Gets the cached translation results for the given class and individual

Parameters:
clazz - the class
individual - the individual
Returns:
the cached translation results (if available), or null (if not available; i.e., isCached(ATermAppl, AtermAppl) returns false).
Throws:
ValidationException

cache

public void cache(aterm.ATermAppl clazz,
                  aterm.ATermAppl individual,
                  java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translation)
Stores the results of translation of the given class and individual.

Parameters:
clazz - the class
individual - the individual
translation - the translation results

cacheValidationException

public void cacheValidationException(aterm.ATermAppl clazz,
                                     aterm.ATermAppl individual,
                                     ValidationException exception)


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.