コード例 #1
0
 PrecomputedMethodGraph() {
   LinkedHashMap<MethodDescription.Token, MethodGraph.Node> nodes =
       new LinkedHashMap<MethodDescription.Token, MethodGraph.Node>(2);
   MethodDescription callMethod =
       new TypeDescription.ForLoadedType(Callable.class)
           .getDeclaredMethods()
           .filter(named("call"))
           .getOnly();
   nodes.put(callMethod.asToken(), new MethodGraph.Node.Simple(callMethod));
   MethodDescription runMethod =
       new TypeDescription.ForLoadedType(Runnable.class)
           .getDeclaredMethods()
           .filter(named("run"))
           .getOnly();
   nodes.put(runMethod.asToken(), new MethodGraph.Node.Simple(runMethod));
   MethodGraph methodGraph = new MethodGraph.Simple(nodes);
   this.methodGraph =
       new MethodGraph.Linked.Delegation(
           methodGraph, methodGraph, Collections.<TypeDescription, MethodGraph>emptyMap());
 }