org.aksw.commons.jena.util
Class CachedCommonProperties

java.lang.Object
  extended by org.aksw.commons.jena.util.CachedCommonProperties

@Guarded(applyFieldConstraintsToConstructors=true)
public class CachedCommonProperties
extends Object

Cached version of CommonProperties. The constructor tries to load the cache from the given file. If the file does not exist, an empty cache is created and filled with every cache miss. Call save() to write the cache on disk. Set offline to true if you want to use the cached values only. Values from the cache are used regardless of the original parameters for threshold, endpoint and sampleSize.

Author:
Konrad Höffner

Field Summary
 boolean offline
           
 
Constructor Summary
CachedCommonProperties(File cacheFile, String endpoint, Double threshold, Integer maxResultSize, Integer sampleSize)
           
 
Method Summary
 LinkedHashMap<String,Integer> getCommonProperties(String where)
           
 void save()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

offline

public boolean offline
Constructor Detail

CachedCommonProperties

public CachedCommonProperties(File cacheFile,
                              String endpoint,
                              Double threshold,
                              Integer maxResultSize,
                              Integer sampleSize)
                       throws IOException
Throws:
IOException
Method Detail

getCommonProperties

public LinkedHashMap<String,Integer> getCommonProperties(@NotNull@NotEmpty
                                                         String where)

save

public void save()
          throws IOException
Throws:
IOException


Copyright © 2012. All Rights Reserved.