com.google.caja.plugin.stages
Class JobCache

java.lang.Object
  extended by com.google.caja.plugin.stages.JobCache

public abstract class JobCache
extends java.lang.Object

Caches the result of expensive pipeline stages.

Author:
mikesamuel@gmail.com

Nested Class Summary
static interface JobCache.Key
           
static interface JobCache.Keys
           
 
Field Summary
static SyntheticAttributeKey<java.lang.Boolean> NO_CACHE
           
private static JobCache.Keys NONE
           
 
Constructor Summary
JobCache()
           
 
Method Summary
abstract  java.util.List<? extends Job> fetch(JobCache.Key k)
           
abstract  JobCache.Key forJob(ContentType type, ParseTreeNode node)
          Given the parts of a Job, generates a cache key for that job.
static JobCache.Keys none()
          A nullish instance such that Iterable.iterator() is empty.
abstract  void store(JobCache.Key k, java.util.List<? extends Job> derivatives)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

private static final JobCache.Keys NONE

NO_CACHE

public static final SyntheticAttributeKey<java.lang.Boolean> NO_CACHE
Constructor Detail

JobCache

public JobCache()
Method Detail

forJob

public abstract JobCache.Key forJob(ContentType type,
                                    ParseTreeNode node)
Given the parts of a Job, generates a cache key for that job.


fetch

public abstract java.util.List<? extends Job> fetch(JobCache.Key k)
Returns:
null to indicate a cache miss, as distinct from the empty list.

store

public abstract void store(JobCache.Key k,
                           java.util.List<? extends Job> derivatives)

none

public static JobCache.Keys none()
A nullish instance such that Iterable.iterator() is empty.



Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0