Class CachingPartialFunction<A,​B>

  • All Implemented Interfaces:
    scala.Function1<A,​B>, scala.PartialFunction<A,​B>

    public abstract class CachingPartialFunction<A,​B>
    extends scala.runtime.AbstractPartialFunction<A,​B>
    INTERNAL API

    This is a specialized variant of PartialFunction which is only applicable if you know that isDefinedAt(x) is always called before apply(x)—with the same x of course.

    match(x) will be called for isDefinedAt(x) only, and its semantics are the same as for JavaPartialFunction (apart from the missing because unneeded boolean argument).

    This class is used internal to TestKit and should not be extended by client code directly.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface scala.Function1

        scala.Function1.UnliftOps<A extends java.lang.Object,​B extends java.lang.Object>, scala.Function1.UnliftOps$
      • Nested classes/interfaces inherited from interface scala.PartialFunction

        scala.PartialFunction.ElementWiseExtractor<A extends java.lang.Object,​B extends java.lang.Object>, scala.PartialFunction.ElementWiseExtractor$
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      B apply​(A x)  
      B cache()  
      void cache_$eq​(B x$1)  
      boolean isDefinedAt​(A x)  
      abstract B match​(A x)  
      • Methods inherited from class scala.runtime.AbstractPartialFunction

        andThen, andThen, apply$mcDD$sp, apply$mcDF$sp, apply$mcDI$sp, apply$mcDJ$sp, apply$mcFD$sp, apply$mcFF$sp, apply$mcFI$sp, apply$mcFJ$sp, apply$mcID$sp, apply$mcIF$sp, apply$mcII$sp, apply$mcIJ$sp, apply$mcJD$sp, apply$mcJF$sp, apply$mcJI$sp, apply$mcJJ$sp, apply$mcVD$sp, apply$mcVF$sp, apply$mcVI$sp, apply$mcVJ$sp, apply$mcZD$sp, apply$mcZF$sp, apply$mcZI$sp, apply$mcZJ$sp, applyOrElse, compose, compose, elementWise, lift, orElse, runWith, toString, unapply
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CachingPartialFunction

        public CachingPartialFunction()
    • Method Detail

      • apply

        public final B apply​(A x)
        Specified by:
        apply in interface scala.Function1<A,​B>
        Overrides:
        apply in class scala.runtime.AbstractPartialFunction<A,​B>
      • cache

        public B cache()
      • cache_$eq

        public void cache_$eq​(B x$1)
      • isDefinedAt

        public final boolean isDefinedAt​(A x)
      • match

        public abstract B match​(A x)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception