Skip to content

Commit

Permalink
Retranslate Java.
Browse files Browse the repository at this point in the history
  • Loading branch information
shunter committed Aug 13, 2019
1 parent 33b0347 commit 5ee1648
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,44 @@ public static Action of(@Nonnull Function f) {
return new FunctionImpl(f);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate
* from a method reference to an instance method.
*
* @param f
* The function which will be invoked.
* @param targetObject
* The class instance on which the delegate will invoke the method.
* @param methodName
* The name of the instance method.
* @param methodParameterClasses
* The type of the parameters of the instance method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static Action of(@Nonnull Function f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl(f, targetObject, methodName, methodParameterClasses);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate
* from a method reference to a static method.
*
* @param f
* The function which will be invoked.
* @param targetClass
* The class that defines the method.
* @param methodName
* The name of the static method.
* @param methodParameterClasses
* The type of the parameters of the static method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static Action of(@Nonnull Function f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl(f, targetClass, methodName, methodParameterClasses);
}

private static final class Multicast extends Action implements MulticastDelegate<Action> {
@Nonnull
private final MulticastList<Action> delegates;
Expand Down Expand Up @@ -202,6 +240,16 @@ public FunctionImpl(@Nonnull Function f) {
this.f = f;
}

public FunctionImpl(@Nonnull Function f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetObject, methodName, methodParameterClasses);
this.f = f;
}

public FunctionImpl(@Nonnull Function f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetClass, methodName, methodParameterClasses);
this.f = f;
}

@Override
public void invoke() {
f.invoke();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,44 @@ public static <TResult> Func1<TResult> of(@Nonnull Function<TResult> f) {
return new FunctionImpl<>(f);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate
* from a method reference to an instance method.
*
* @param f
* The function which will be invoked.
* @param targetObject
* The class instance on which the delegate will invoke the method.
* @param methodName
* The name of the instance method.
* @param methodParameterClasses
* The type of the parameters of the instance method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static <TResult> Func1<TResult> of(@Nonnull Function<TResult> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl<>(f, targetObject, methodName, methodParameterClasses);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate
* from a method reference to a static method.
*
* @param f
* The function which will be invoked.
* @param targetClass
* The class that defines the method.
* @param methodName
* The name of the static method.
* @param methodParameterClasses
* The type of the parameters of the static method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static <TResult> Func1<TResult> of(@Nonnull Function<TResult> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl<>(f, targetClass, methodName, methodParameterClasses);
}

/**
* A functional interface for the containing delegate type.
*/
Expand All @@ -106,6 +144,16 @@ public FunctionImpl(@Nonnull Function<TResult> f) {
this.f = f;
}

public FunctionImpl(@Nonnull Function<TResult> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetObject, methodName, methodParameterClasses);
this.f = f;
}

public FunctionImpl(@Nonnull Function<TResult> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetClass, methodName, methodParameterClasses);
this.f = f;
}

@Override
public TResult invoke() {
return f.invoke();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,34 @@ public static <TWrappedWriter extends ICesiumPropertyWriter, TValue> CesiumWrite
return new FunctionImpl<TWrappedWriter, TValue>(f);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to an instance method.
* @param f The function which will be invoked.
* @param targetObject The class instance on which the delegate will invoke the method.
* @param methodName The name of the instance method.
* @param methodParameterClasses The type of the parameters of the instance method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static <TWrappedWriter extends ICesiumPropertyWriter, TValue> CesiumWriterAdaptorWriteCallback<TWrappedWriter, TValue> of(@Nonnull Function<TWrappedWriter, TValue> f,
@Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl<TWrappedWriter, TValue>(f, targetObject, methodName, methodParameterClasses);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to a static method.
* @param f The function which will be invoked.
* @param targetClass The class that defines the method.
* @param methodName The name of the static method.
* @param methodParameterClasses The type of the parameters of the static method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static <TWrappedWriter extends ICesiumPropertyWriter, TValue> CesiumWriterAdaptorWriteCallback<TWrappedWriter, TValue> of(@Nonnull Function<TWrappedWriter, TValue> f,
@Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl<TWrappedWriter, TValue>(f, targetClass, methodName, methodParameterClasses);
}

/**
* A functional interface for the containing delegate type.
* @param <TWrappedWriter> The type of the wrapped writer.
Expand Down Expand Up @@ -119,6 +147,16 @@ public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f) {
this.f = f;
}

public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetObject, methodName, methodParameterClasses);
this.f = f;
}

public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetClass, methodName, methodParameterClasses);
this.f = f;
}

@Override
public void invoke(@Nonnull TWrappedWriter wrappedWriter, TValue value) {
f.invoke(wrappedWriter, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,34 @@ public static <TWrappedWriter extends ICesiumPropertyWriter> CesiumWriterAdaptor
return new FunctionImpl<TWrappedWriter>(f);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to an instance method.
* @param f The function which will be invoked.
* @param targetObject The class instance on which the delegate will invoke the method.
* @param methodName The name of the instance method.
* @param methodParameterClasses The type of the parameters of the instance method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static <TWrappedWriter extends ICesiumPropertyWriter> CesiumWriterAdaptorWriteDeleteCallback<TWrappedWriter> of(@Nonnull Function<TWrappedWriter> f, @Nonnull Object targetObject,
@Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl<TWrappedWriter>(f, targetObject, methodName, methodParameterClasses);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to a static method.
* @param f The function which will be invoked.
* @param targetClass The class that defines the method.
* @param methodName The name of the static method.
* @param methodParameterClasses The type of the parameters of the static method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static <TWrappedWriter extends ICesiumPropertyWriter> CesiumWriterAdaptorWriteDeleteCallback<TWrappedWriter> of(@Nonnull Function<TWrappedWriter> f, @Nonnull Class<?> targetClass,
@Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl<TWrappedWriter>(f, targetClass, methodName, methodParameterClasses);
}

/**
* A functional interface for the containing delegate type.
* @param <TWrappedWriter> The type of the wrapped writer.
Expand All @@ -106,6 +134,16 @@ public FunctionImpl(@Nonnull Function<TWrappedWriter> f) {
this.f = f;
}

public FunctionImpl(@Nonnull Function<TWrappedWriter> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetObject, methodName, methodParameterClasses);
this.f = f;
}

public FunctionImpl(@Nonnull Function<TWrappedWriter> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetClass, methodName, methodParameterClasses);
this.f = f;
}

@Override
public void invoke(@Nonnull TWrappedWriter wrappedWriter) {
f.invoke(wrappedWriter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,34 @@ public static <TWrappedWriter extends ICesiumPropertyWriter & ICesiumInterpolata
return new FunctionImpl<TWrappedWriter, TValue>(f);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to an instance method.
* @param f The function which will be invoked.
* @param targetObject The class instance on which the delegate will invoke the method.
* @param methodName The name of the instance method.
* @param methodParameterClasses The type of the parameters of the instance method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static <TWrappedWriter extends ICesiumPropertyWriter & ICesiumInterpolatablePropertyWriter, TValue> CesiumWriterAdaptorWriteSamplesCallback<TWrappedWriter, TValue> of(
@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl<TWrappedWriter, TValue>(f, targetObject, methodName, methodParameterClasses);
}

/**
* Create a delegate for the given interface. This can be used to create a delegate from a method reference to a static method.
* @param f The function which will be invoked.
* @param targetClass The class that defines the method.
* @param methodName The name of the static method.
* @param methodParameterClasses The type of the parameters of the static method.
* @return A new delegate that will invoke the given function.
*/
@Nonnull
public static <TWrappedWriter extends ICesiumPropertyWriter & ICesiumInterpolatablePropertyWriter, TValue> CesiumWriterAdaptorWriteSamplesCallback<TWrappedWriter, TValue> of(
@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
return new FunctionImpl<TWrappedWriter, TValue>(f, targetClass, methodName, methodParameterClasses);
}

/**
* A functional interface for the containing delegate type.
* @param <TWrappedWriter> The type of the wrapped writer.
Expand Down Expand Up @@ -137,6 +165,16 @@ public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f) {
this.f = f;
}

public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetObject, methodName, methodParameterClasses);
this.f = f;
}

public FunctionImpl(@Nonnull Function<TWrappedWriter, TValue> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses) {
super(targetClass, methodName, methodParameterClasses);
this.f = f;
}

@Override
public void invoke(TWrappedWriter wrappedWriter, List<JulianDate> dates, List<TValue> values, int startIndex, int length) {
f.invoke(wrappedWriter, dates, values, startIndex, length);
Expand Down

0 comments on commit 5ee1648

Please sign in to comment.