Class ResultCache<T>

    • Constructor Detail

      • ResultCache

        public ResultCache()
    • Method Detail

      • nowUncached

        protected abstract T nowUncached()
      • isExecuted

        protected boolean isExecuted()
      • now

        public final T now()
        Description copied from interface: Result
        Waits if necessary for the computation to complete, and then retrieves its result. If the computation produced an exception, it will be thrown here.
        Specified by:
        now in interface Result<T>
        Returns:
        the computed result
      • postExecuteHook

        protected void postExecuteHook()
        Executed once after the cached value is assigned.
      • writeReplace

        protected Object writeReplace()
                               throws ObjectStreamException
        When this serializes, write out a simple version that doesn't hold complicated links to internal structures. This is safe as long as nobody ever tries to cast to ResultCache directly, which should never happen.
        Throws:
        ObjectStreamException
      • toString

        public String toString()
        We can get away with this because the subclass almost always provides concrete types
        Overrides:
        toString in class Object