Okay, I have found the solution
by using a some googling. I will try now to explain the solution, so maybe this can be useful to some other people that have the same question. What the .. is going on here???
First of all I found what is happening in the line:
(field.getStyle() & Field.FIELD_RIGHT)
The following takes place on binary level:
10100000000000100000001000000000000000000000000000 000000
00000000000000000000001000000000000000000000000000 000000 AND
----------------------------------------------------------------
00000000000000000000001000000000000000000000000000 000000
So let me try to explain it simple the following value in field.getStyle() are all the flags that define the styles of this field. So if you try to watch the value with the debugger you get an decimal result, but actually you need to look a little bit deeper into the binary code of this value. In order to filter out the right style flag to compare it with the same style flag you do the AND binary operand. This operand will return only the flags that are set on both binary values.
field.getStyle() = 10100000000000100000001000000000000000000000000000 000000
Field.FIELD_RIGHT = 00000000000000000000001000000000000000000000000000 000000 AND
will result into:
----------------------------------------------------------------
00000000000000000000001000000000000000000000000000 000000
So if you have the following line (field.getStyle() & Field.FIELD_LEFT)
field.getStyle() = 10100000000000100000001000000000000000000000000000 000000
Field.FIELD_LEFT = 00000000000000000000000100000000000000000000000000 000000 AND
will result into:
----------------------------------------------------------------
00000000000000000000000000000000000000000000000000 000000
So this works pretty well. But I found a little problem or error to watch out for when you want to use the style flag Field.FIELD_HCENTER this one has the flags for Field.FIELD_RIGHT and Field.FIELD_LEFT set so in both equations above it will return into "true" (false positive). So if you want to check for these three style options. You have to check first for Field.FIELD_RIGHT and for Field.FIELD_LEFT and then as last for Field.FIELD_HCENTER so it wont act as one of the others but as a Horizontal Center. If you do opposite so you check for Field.FIELD_HCENTER and then for Field.FIELD_RIGHT you will overwrite everything you have done inside the Field.FIELD_HCENTER.
I hope this is clear now for everybody with the same question. If not let me know and I will try to explain different. If I said something wrong please correct me :-D