java.nio.channels.MembershipKey API
Rémi Forax
forax at univ-mlv.fr
Tue Oct 21 07:53:45 PDT 2008
I Alan, i gang,
I've just noticed that latest (or the one before) jdk7 beta contains
updates in the packages java.nio.channels.*
I've noted inconsistancy between MembershipKey and SelectionKey
in the way the method are named.
Most of the class of the nio packages doesn't use get/set spec (bean spec)
but use the same method name without the get/set prefix
something like position()/position(value).
But MembershipKey doesn't seem to follow the same pattern,
by example the channel is get using getChannel(),
in SelectionKey, the channel is get using channel().
In my opinion, getChannel(), getGroup(), getNetworkInterface() and
getSourceAddress() should be renamed to channel(), group(),
networkInterface()
and sourceAddress().
cheers,
Rémi
More information about the nio-dev
mailing list