Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java syntax >>, &, ? and :

Tags:

java

syntax

I don't understand what the >>, &, ? and : mean in this program:

case MotionEvent.ACTION_POINTER_UP: {
        // Extract the index of the pointer that left the touch sensor
        final int pointerIndex = (action & MotionEvent.ACTION_POINTER_INDEX_MASK) 
                >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
        final int pointerId = ev.getPointerId(pointerIndex);
        if (pointerId == mActivePointerId) {
            // This was our active pointer going up. Choose a new
            // active pointer and adjust accordingly.
            final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
            mLastTouchX = ev.getX(newPointerIndex);
            mLastTouchY = ev.getY(newPointerIndex);
            mActivePointerId = ev.getPointerId(newPointerIndex);
        }
        break;

Could you help me ? Google doesn't do search on non-alphanumeric characters...

like image 536
Flavian Hautbois Avatar asked Dec 02 '22 00:12

Flavian Hautbois


1 Answers

  • Bitwise Shift - >>
  • Bitwise AND - &
  • Ternary - ? :
like image 179
Tim Cooper Avatar answered Dec 28 '22 02:12

Tim Cooper