yes, it is an optimization to save space.

-igor

On Tue, Aug 18, 2009 at 7:58 AM, Nicolas
Melendez<[email protected]> wrote:
> Hi everybody, does anybody know why wicket uses FLAGS and bits
> operator in Component Class.
> for example:
> in Component.java
>
> line 650 :private int flags = FLAG_VISIBLE | FLAG_ESCAPE_MODEL_STRINGS
> | FLAG_VERSIONED | FLAG_ENABLED |
>                FLAG_IS_RENDER_ALLOWED | FLAG_VISIBILITY_ALLOWED;
>
>
> line 3456 :     protected final boolean getFlag(final int flag)
>        {
>                return (flags & flag) != 0;
>        }
>
> for those who don't know what & operator do: return 1, if the two
> operators are 1, otherwise return 0
>
> Are the because optimization?
> i have no experience doing frameworks, can someone with experience tell me 
> why?
> Thank You!
> NM
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to