forked from EB-wilson/JavaDynamilizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunction.java
More file actions
34 lines (27 loc) · 898 Bytes
/
Copy pathFunction.java
File metadata and controls
34 lines (27 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package dynamilize;
@FunctionalInterface
public interface Function<S, R>{
R invoke(DynamicObject<S> self, ArgumentList args);
default R invoke(DynamicObject<S> self, Object... args){
ArgumentList lis = ArgumentList.as(args);
R r = invoke(self, lis);
lis.type().recycle();
lis.recycle();
return r;
}
default R invoke(DynamicObject<S> self, FunctionType type, Object... args){
ArgumentList lis = ArgumentList.asWithType(type, args);
R r = invoke(self, lis);
lis.recycle();
return r;
}
interface NonRetFunction<S>{
void invoke(DynamicObject<S> self, ArgumentList args);
}
interface SuperGetFunction<S, R>{
R invoke(DynamicObject<S> self, DataPool.ReadOnlyPool superPointer, ArgumentList args);
}
interface NonRetSuperGetFunc<S>{
void invoke(DynamicObject<S> self, DataPool.ReadOnlyPool superPointer, ArgumentList args);
}
}