Default implement RealCursor.next()
A potential argument against this could be performance: Every call to the default next() goes to polymorphic fwd() and get() calls. However, I did a benchmark, and it doesn't matter. Probably because the method is so small it is inlined everywhere. Additionally, we had already implemented next() in AbstractCursor, AbstractCursorInt, etc, so we would have this problem already anyway.
Default implement IterableRealInterval.iterator() and IterableRealInterval.firstElement()
Remove implementations of java.util.Iterator.remove(). There is a default implementation in the java.util.Iterator interface now.
Deprecate and default implement RealCursor.copyCursor().
@axtimwalde already took care of copyRandomAccess() and copyRealRandomAccess() in 4ae96db3 and 054a716d, respectively.
Remove abstract overrides of abstract methods to the exact same signature.
Remove meaningless final modifiers from arguments of abstract methods.
final annotations of method arguments are relevant to the method implementation, but not to the caller. (It is even allowed to override methods with non-final arguments, if arguments are declared final in the super class.)
Remove redundant modifiers:
In particular, remove public modifier from interface methods. Remove public, static, and final from interface fields. Remove static from inner enums. Remove private from enum constructors. These are all implicit in the respective context.
@axtimwalde @StephanPreibisch I requested your review, but I think you don't have to look at the code... If you could just read the PR description and give your opinion on the general direction ...
Default implement
Iterator.jumpFwd()
Default implement
RealCursor.next()
A potential argument against this could be performance: Every call to the defaultnext()
goes to polymorphicfwd()
andget()
calls. However, I did a benchmark, and it doesn't matter. Probably because the method is so small it is inlined everywhere. Additionally, we had already implementednext()
inAbstractCursor
,AbstractCursorInt
, etc, so we would have this problem already anyway.Default implement
IterableRealInterval.iterator()
andIterableRealInterval.firstElement()
Remove implementations of
java.util.Iterator.remove()
. There is a default implementation in thejava.util.Iterator
interface now.Deprecate and default implement
RealCursor.copyCursor()
. @axtimwalde already took care ofcopyRandomAccess()
andcopyRealRandomAccess()
in 4ae96db3 and 054a716d, respectively.Remove abstract overrides of abstract methods to the exact same signature.
Remove meaningless
final
modifiers from arguments of abstract methods.final
annotations of method arguments are relevant to the method implementation, but not to the caller. (It is even allowed to override methods with non-final arguments, if arguments are declaredfinal
in the super class.)Remove redundant modifiers: In particular, remove
public
modifier from interface methods. Removepublic
,static
, andfinal
from interface fields. Removestatic
from inner enums. Removeprivate
from enum constructors. These are all implicit in the respective context.