Enumerable is a “wide” interface with a lot of methods, and I didn’t want every 
implementation to have to implement every method. So I created the class 
EnumerableDefaults to hold those default implementations. The methods are 
static but the first argument is always the Enumerable.

If we only supported JDK 8 and above I would have used the feature that allows 
default implementations of interface methods[1]. I was basing the linq4j API on 
LINQ[2] and lack of default methods was galling, because C# has had default 
methods for a long time.

Julian

[1] https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html 
<https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html>

[2] 
https://msdn.microsoft.com/en-us/library/system.linq.enumerable(v=vs.110).aspx 
<https://msdn.microsoft.com/en-us/library/system.linq.enumerable(v=vs.110).aspx>
 

> On Jul 17, 2017, at 9:51 AM, Atri Sharma <[email protected]> wrote:
> 
> Hi All,
> 
> 
> I needed some help in understanding join internals please. I
> understood EnumerableJoin and its internals, but not sure as to how
> the translation to EnumerableDefaults went through. Specifically, I
> did not understand why EnumerableJoin does not have a physical
> equivalent that implements EnumerableDefaults#join and why it goes
> through to EnumerableDefaults. Is EnumerableDefaults is the physical
> conversion operator for all Enumerable* logical operators?
> 
> Please advise.
> 
> Regards,
> 
> Atri

Reply via email to