Skip to content

Commit 5ee1648

Browse files
committed
Retranslate Java.
1 parent 33b0347 commit 5ee1648

File tree

5 files changed

+210
-0
lines changed

5 files changed

+210
-0
lines changed

Java/CesiumLanguageWriter/src/agi/foundation/compatibility/Action.java

+48
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,44 @@ public static Action of(@Nonnull Function f) {
122122
return new FunctionImpl(f);
123123
}
124124

125+
/**
126+
* Create a delegate for the given interface. This can be used to create a delegate
127+
* from a method reference to an instance method.
128+
*
129+
* @param f
130+
* The function which will be invoked.
131+
* @param targetObject
132+
* The class instance on which the delegate will invoke the method.
133+
* @param methodName
134+
* The name of the instance method.
135+
* @param methodParameterClasses
136+
* The type of the parameters of the instance method.
137+
* @return A new delegate that will invoke the given function.
138+
*/
139+
@Nonnull
140+
public static Action of(@Nonnull Function f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
141+
return new FunctionImpl(f, targetObject, methodName, methodParameterClasses);
142+
}
143+
144+
/**
145+
* Create a delegate for the given interface. This can be used to create a delegate
146+
* from a method reference to a static method.
147+
*
148+
* @param f
149+
* The function which will be invoked.
150+
* @param targetClass
151+
* The class that defines the method.
152+
* @param methodName
153+
* The name of the static method.
154+
* @param methodParameterClasses
155+
* The type of the parameters of the static method.
156+
* @return A new delegate that will invoke the given function.
157+
*/
158+
@Nonnull
159+
public static Action of(@Nonnull Function f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
160+
return new FunctionImpl(f, targetClass, methodName, methodParameterClasses);
161+
}
162+
125163
private static final class Multicast extends Action implements MulticastDelegate<Action> {
126164
@Nonnull
127165
private final MulticastList<Action> delegates;
@@ -202,6 +240,16 @@ public FunctionImpl(@Nonnull Function f) {
202240
this.f = f;
203241
}
204242

243+
public FunctionImpl(@Nonnull Function f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
244+
super(targetObject, methodName, methodParameterClasses);
245+
this.f = f;
246+
}
247+
248+
public FunctionImpl(@Nonnull Function f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
249+
super(targetClass, methodName, methodParameterClasses);
250+
this.f = f;
251+
}
252+
205253
@Override
206254
public void invoke() {
207255
f.invoke();

Java/CesiumLanguageWriter/src/agi/foundation/compatibility/Func1.java

+48
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,44 @@ public static <TResult> Func1<TResult> of(@Nonnull Function<TResult> f) {
8484
return new FunctionImpl<>(f);
8585
}
8686

87+
/**
88+
* Create a delegate for the given interface. This can be used to create a delegate
89+
* from a method reference to an instance method.
90+
*
91+
* @param f
92+
* The function which will be invoked.
93+
* @param targetObject
94+
* The class instance on which the delegate will invoke the method.
95+
* @param methodName
96+
* The name of the instance method.
97+
* @param methodParameterClasses
98+
* The type of the parameters of the instance method.
99+
* @return A new delegate that will invoke the given function.
100+
*/
101+
@Nonnull
102+
public static <TResult> Func1<TResult> of(@Nonnull Function<TResult> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
103+
return new FunctionImpl<>(f, targetObject, methodName, methodParameterClasses);
104+
}
105+
106+
/**
107+
* Create a delegate for the given interface. This can be used to create a delegate
108+
* from a method reference to a static method.
109+
*
110+
* @param f
111+
* The function which will be invoked.
112+
* @param targetClass
113+
* The class that defines the method.
114+
* @param methodName
115+
* The name of the static method.
116+
* @param methodParameterClasses
117+
* The type of the parameters of the static method.
118+
* @return A new delegate that will invoke the given function.
119+
*/
120+
@Nonnull
121+
public static <TResult> Func1<TResult> of(@Nonnull Function<TResult> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
122+
return new FunctionImpl<>(f, targetClass, methodName, methodParameterClasses);
123+
}
124+
87125
/**
88126
* A functional interface for the containing delegate type.
89127
*/
@@ -106,6 +144,16 @@ public FunctionImpl(@Nonnull Function<TResult> f) {
106144
this.f = f;
107145
}
108146

147+
public FunctionImpl(@Nonnull Function<TResult> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
148+
super(targetObject, methodName, methodParameterClasses);
149+
this.f = f;
150+
}
151+
152+
public FunctionImpl(@Nonnull Function<TResult> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
153+
super(targetClass, methodName, methodParameterClasses);
154+
this.f = f;
155+
}
156+
109157
@Override
110158
public TResult invoke() {
111159
return f.invoke();

Java/CesiumLanguageWriter/translatedSrc/cesiumlanguagewriter/advanced/CesiumWriterAdaptorWriteCallback.java

+38
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,34 @@ public static <TWrappedWriter extends ICesiumPropertyWriter, TValue> CesiumWrite
8888
return new FunctionImpl<TWrappedWriter, TValue>(f);
8989
}
9090

91+
/**
92+
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to an instance method.
93+
* @param f The function which will be invoked.
94+
* @param targetObject The class instance on which the delegate will invoke the method.
95+
* @param methodName The name of the instance method.
96+
* @param methodParameterClasses The type of the parameters of the instance method.
97+
* @return A new delegate that will invoke the given function.
98+
*/
99+
@Nonnull
100+
public static <TWrappedWriter extends ICesiumPropertyWriter, TValue> CesiumWriterAdaptorWriteCallback<TWrappedWriter, TValue> of(@Nonnull Function<TWrappedWriter, TValue> f,
101+
@Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
102+
return new FunctionImpl<TWrappedWriter, TValue>(f, targetObject, methodName, methodParameterClasses);
103+
}
104+
105+
/**
106+
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to a static method.
107+
* @param f The function which will be invoked.
108+
* @param targetClass The class that defines the method.
109+
* @param methodName The name of the static method.
110+
* @param methodParameterClasses The type of the parameters of the static method.
111+
* @return A new delegate that will invoke the given function.
112+
*/
113+
@Nonnull
114+
public static <TWrappedWriter extends ICesiumPropertyWriter, TValue> CesiumWriterAdaptorWriteCallback<TWrappedWriter, TValue> of(@Nonnull Function<TWrappedWriter, TValue> f,
115+
@Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
116+
return new FunctionImpl<TWrappedWriter, TValue>(f, targetClass, methodName, methodParameterClasses);
117+
}
118+
91119
/**
92120
* A functional interface for the containing delegate type.
93121
* @param <TWrappedWriter> The type of the wrapped writer.
@@ -119,6 +147,16 @@ public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f) {
119147
this.f = f;
120148
}
121149

150+
public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
151+
super(targetObject, methodName, methodParameterClasses);
152+
this.f = f;
153+
}
154+
155+
public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
156+
super(targetClass, methodName, methodParameterClasses);
157+
this.f = f;
158+
}
159+
122160
@Override
123161
public void invoke(@Nonnull TWrappedWriter wrappedWriter, TValue value) {
124162
f.invoke(wrappedWriter, value);

Java/CesiumLanguageWriter/translatedSrc/cesiumlanguagewriter/advanced/CesiumWriterAdaptorWriteDeleteCallback.java

+38
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,34 @@ public static <TWrappedWriter extends ICesiumPropertyWriter> CesiumWriterAdaptor
8080
return new FunctionImpl<TWrappedWriter>(f);
8181
}
8282

83+
/**
84+
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to an instance method.
85+
* @param f The function which will be invoked.
86+
* @param targetObject The class instance on which the delegate will invoke the method.
87+
* @param methodName The name of the instance method.
88+
* @param methodParameterClasses The type of the parameters of the instance method.
89+
* @return A new delegate that will invoke the given function.
90+
*/
91+
@Nonnull
92+
public static <TWrappedWriter extends ICesiumPropertyWriter> CesiumWriterAdaptorWriteDeleteCallback<TWrappedWriter> of(@Nonnull Function<TWrappedWriter> f, @Nonnull Object targetObject,
93+
@Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
94+
return new FunctionImpl<TWrappedWriter>(f, targetObject, methodName, methodParameterClasses);
95+
}
96+
97+
/**
98+
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to a static method.
99+
* @param f The function which will be invoked.
100+
* @param targetClass The class that defines the method.
101+
* @param methodName The name of the static method.
102+
* @param methodParameterClasses The type of the parameters of the static method.
103+
* @return A new delegate that will invoke the given function.
104+
*/
105+
@Nonnull
106+
public static <TWrappedWriter extends ICesiumPropertyWriter> CesiumWriterAdaptorWriteDeleteCallback<TWrappedWriter> of(@Nonnull Function<TWrappedWriter> f, @Nonnull Class<?> targetClass,
107+
@Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
108+
return new FunctionImpl<TWrappedWriter>(f, targetClass, methodName, methodParameterClasses);
109+
}
110+
83111
/**
84112
* A functional interface for the containing delegate type.
85113
* @param <TWrappedWriter> The type of the wrapped writer.
@@ -106,6 +134,16 @@ public FunctionImpl(@Nonnull Function<TWrappedWriter> f) {
106134
this.f = f;
107135
}
108136

137+
public FunctionImpl(@Nonnull Function<TWrappedWriter> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
138+
super(targetObject, methodName, methodParameterClasses);
139+
this.f = f;
140+
}
141+
142+
public FunctionImpl(@Nonnull Function<TWrappedWriter> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
143+
super(targetClass, methodName, methodParameterClasses);
144+
this.f = f;
145+
}
146+
109147
@Override
110148
public void invoke(@Nonnull TWrappedWriter wrappedWriter) {
111149
f.invoke(wrappedWriter);

Java/CesiumLanguageWriter/translatedSrc/cesiumlanguagewriter/advanced/CesiumWriterAdaptorWriteSamplesCallback.java

+38
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,34 @@ public static <TWrappedWriter extends ICesiumPropertyWriter & ICesiumInterpolata
9999
return new FunctionImpl<TWrappedWriter, TValue>(f);
100100
}
101101

102+
/**
103+
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to an instance method.
104+
* @param f The function which will be invoked.
105+
* @param targetObject The class instance on which the delegate will invoke the method.
106+
* @param methodName The name of the instance method.
107+
* @param methodParameterClasses The type of the parameters of the instance method.
108+
* @return A new delegate that will invoke the given function.
109+
*/
110+
@Nonnull
111+
public static <TWrappedWriter extends ICesiumPropertyWriter & ICesiumInterpolatablePropertyWriter, TValue> CesiumWriterAdaptorWriteSamplesCallback<TWrappedWriter, TValue> of(
112+
@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
113+
return new FunctionImpl<TWrappedWriter, TValue>(f, targetObject, methodName, methodParameterClasses);
114+
}
115+
116+
/**
117+
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to a static method.
118+
* @param f The function which will be invoked.
119+
* @param targetClass The class that defines the method.
120+
* @param methodName The name of the static method.
121+
* @param methodParameterClasses The type of the parameters of the static method.
122+
* @return A new delegate that will invoke the given function.
123+
*/
124+
@Nonnull
125+
public static <TWrappedWriter extends ICesiumPropertyWriter & ICesiumInterpolatablePropertyWriter, TValue> CesiumWriterAdaptorWriteSamplesCallback<TWrappedWriter, TValue> of(
126+
@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
127+
return new FunctionImpl<TWrappedWriter, TValue>(f, targetClass, methodName, methodParameterClasses);
128+
}
129+
102130
/**
103131
* A functional interface for the containing delegate type.
104132
* @param <TWrappedWriter> The type of the wrapped writer.
@@ -137,6 +165,16 @@ public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f) {
137165
this.f = f;
138166
}
139167

168+
public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
169+
super(targetObject, methodName, methodParameterClasses);
170+
this.f = f;
171+
}
172+
173+
public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
174+
super(targetClass, methodName, methodParameterClasses);
175+
this.f = f;
176+
}
177+
140178
@Override
141179
public void invoke(TWrappedWriter wrappedWriter, List<JulianDate> dates, List<TValue> values, int startIndex, int length) {
142180
f.invoke(wrappedWriter, dates, values, startIndex, length);

0 commit comments

Comments
 (0)