public PresentationValue getPresentationValue(ValueContext vc) {
    if (cacheTimeoutMillis > 0) {
      String cacheKey = getCachedValueKey(vc);
      CachedValue cv = (CachedValue) cachedPresentationValues.get(cacheKey);
      if (cv != null) {
        if (cv.isValid()) return (PresentationValue) cv.getValue();
        else cachedPresentationValues.remove(cacheKey);
      }

      PresentationValue value = (PresentationValue) getQueryResults(vc, RESULTSTYLE_PRESENTATION);
      cachedPresentationValues.put(cacheKey, new CachedValue(value, cacheTimeoutMillis));
      return value;
    } else return (PresentationValue) getQueryResults(vc, RESULTSTYLE_PRESENTATION);
  }
  public Value getValue(ValueContext vc) {
    if (cacheTimeoutMillis > 0) {
      String cacheKey = getCachedValueKey(vc);
      CachedValue cv = (CachedValue) cachedValues.get(cacheKey);
      if (cv != null) {
        if (cv.isValid()) return cv.getValue();
        else cachedValues.remove(cacheKey);
      }

      Value value = getQueryResults(vc, resultStyle);
      cachedValues.put(cacheKey, new CachedValue(value, cacheTimeoutMillis));
      return value;
    } else return getQueryResults(vc, resultStyle);
  }