com.celadari.jsonlogicscala.evaluate
MethodSignatureFinder
Companion object MethodSignatureFinder
class MethodSignatureFinder extends AnyRef
Responsible for finding paths of a compatible classes in case there exists multiple overloaded method versions of operator's method.
class A, class B extends A conditionsValues(a, b, c) (a object of A, b object of B, c object of C) overloaded methods have the following signatures: overloaded_method(A, A): B overloaded_method(A, B): A overloaded_method(A, C): D overloaded_method(A, D): A overloaded_method(B, A): A overloaded_method(B, C): A overloaded_method(D, C): A then compatible paths are Array((overloaded_method(A, A): B), (overloaded_method(B, C): A)) Array((overloaded_method(A, B): A), (overloaded_method(A, C): D)) This search is used on reduce type operators as conditions might not be the same type and which overloaded method to be applied must be found before evaluation.
- Alphabetic
- By Inheritance
- MethodSignatureFinder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new MethodSignatureFinder(conditionsValues: Array[Any], confMethod: MethodConf)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
- val conditionsValues: Array[Any]
-
val
conditionsValuesEval: Stack[Any]
- Attributes
- protected[this]
- val confMethod: MethodConf
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
eval(): Unit
Triggers search for compatible paths with "conditionsValues" and "confMethod".
Triggers search for compatible paths with "conditionsValues" and "confMethod".
- returns
set of compatible paths.
-
def
explorePath(value: Any, ownerMethodOpt: Option[Class[_]], path: Array[(Method, Boolean)]): Set[Array[(Method, Boolean)]]
Returns set of paths.
Returns set of paths. Set of paths corresponds to the different possible paths that extend "path" by adding an overloaded method compatible with "path"'s last element (class/type is com.celadari.jsonlogicscala.evaluate.MethodConf) return type as first input and value as second input.
- returns
set of compatible paths.
- Attributes
- protected[this]
-
def
filterExplorable(objClass: Class[_], value: Any, path: Array[(Method, Boolean)]): Set[Method]
Returns set of overloaded methods of "objClass" that are compatible with return type of the last method of "path" and "value" as first and second input.
Returns set of overloaded methods of "objClass" that are compatible with return type of the last method of "path" and "value" as first and second input.
- returns
set of overloaded methods.
- Attributes
- protected[this]
-
def
findFirstMethods(ownerMethod: Any, value1: Any, value2Opt: Option[Any]): Set[Method]
Returns set of overloaded methods that are compatible with value1 and value2Opt (if defined) as input.
Returns set of overloaded methods that are compatible with value1 and value2Opt (if defined) as input.
- returns
set of overloaded methods.
- Attributes
- protected[this]
-
def
findPaths(): Set[Array[(Method, Boolean)]]
Returns set of optimized compatible paths with "conditionsValues" and "confMethod".
Returns set of optimized compatible paths with "conditionsValues" and "confMethod". If search has not yet been triggered, it is triggered, otherwise returns cached value.
- returns
set of compatible paths.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
initializePaths(): Unit
Initiates parameters values before paths search.
Initiates parameters values before paths search. Required as first search compares classes/types of "conditionsValues"'s first element and second element while next searches compares classes/types of last element of "paths" and current element of "conditionsValues".
- Attributes
- protected[this]
-
var
isEvaluated: Boolean
- Attributes
- protected[this]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
optimizePaths(): Unit
Optimizes found paths by removing a path if there exists another path with a method with sub-types input arguments.
Optimizes found paths by removing a path if there exists another path with a method with sub-types input arguments.
class A, class B extends A, class C, class D extends C, class E path1: Array((method(A, C), _), ...) path2: Array((method(A, D), _), ...) path3: Array((method(B, C), _), ...) path4: Array((method(B, D), _), ...) path5: Array((method(A, E), _), ...) optimized paths are path1: Array((method(B, D), _), ...) path5: Array((method(A, E), _), ...)
Example: -
var
paths: Set[Array[(Method, Boolean)]]
- Attributes
- protected[this]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated