[jdom-interest] Bit masks in ContentFilter

Jason Hunter jhunter at servlets.com
Fri Apr 12 22:40:32 PDT 2002


Elliotte Rusty Harold wrote:
> 
> At 1:14 PM -0700 4/12/02, Jason Hunter wrote:
> 
> >Playing devil's advocate for a second, they use bitmasks in the brand
> >spanking New I/O library.  So new it has New in the name.  :-)
> >
> >Look at the SelectableChannel.register(x, y, OP_ACCEPT) call where
> >OP_ACCEPT is an int in a bitmask.  All around selectors you need to do
> >bitmask work.  I don't think Sun's treating it like a relic from C.
> >
> 
> I haven't really looked at the new I/O API in any depth yet, but what
> this reminds me of more than anything is Unix networking libraries. I
> suspect some of that thinking may have infected the working group and
> led them down a path of less than pure object-oriented virtue. :-)

That may explain why a channel has a method on itself to register with
the selector, instead of letting the selector have a method that accepts
channels.

Since the constructor lets you start with all visible or not, I guess
the mask isn't so necessary.  Usually you're going to just want to
include one or exclude one.  I'm easy either way.

-jh-



More information about the jdom-interest mailing list